debian-mirror-gitlab/lib/gitlab/verify/job_artifacts.rb

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

38 lines
660 B
Ruby
Raw Normal View History

2019-02-15 15:39:39 +05:30
# frozen_string_literal: true
2018-05-09 12:01:36 +05:30
module Gitlab
module Verify
class JobArtifacts < BatchVerifier
def name
'Job artifacts'
end
def describe(object)
"Job artifact: #{object.id}"
end
private
2018-11-08 19:23:39 +05:30
def all_relation
2018-05-09 12:01:36 +05:30
::Ci::JobArtifact.all
end
2018-11-08 19:23:39 +05:30
def local?(artifact)
artifact.local_store?
end
2018-05-09 12:01:36 +05:30
def expected_checksum(artifact)
artifact.file_sha256
end
def actual_checksum(artifact)
Digest::SHA256.file(artifact.file.path).hexdigest
end
2018-11-08 19:23:39 +05:30
def remote_object_exists?(artifact)
artifact.file.file.exists?
end
2018-05-09 12:01:36 +05:30
end
end
end