diff options
author | Nick Thomas <nick@gitlab.com> | 2018-03-06 21:46:36 +0300 |
---|---|---|
committer | Nick Thomas <nick@gitlab.com> | 2018-03-07 20:28:15 +0300 |
commit | 4419d7ea1fa780066016c9527b96dba4f15d3f61 (patch) | |
tree | 3c1211d1558ff0b40c1801ec28bea78ff9636986 /lib/gitlab/verify/job_artifacts.rb | |
parent | 98c8c90e92f8f0407bf048d42ff5e4d76ce57ba0 (diff) |
Implement foreground verification of CI artifacts
Diffstat (limited to 'lib/gitlab/verify/job_artifacts.rb')
-rw-r--r-- | lib/gitlab/verify/job_artifacts.rb | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/lib/gitlab/verify/job_artifacts.rb b/lib/gitlab/verify/job_artifacts.rb new file mode 100644 index 00000000000..03500a61074 --- /dev/null +++ b/lib/gitlab/verify/job_artifacts.rb @@ -0,0 +1,27 @@ +module Gitlab + module Verify + class JobArtifacts < BatchVerifier + def name + 'Job artifacts' + end + + def describe(object) + "Job artifact: #{object.id}" + end + + private + + def relation + ::Ci::JobArtifact.all + end + + def expected_checksum(artifact) + artifact.file_sha256 + end + + def actual_checksum(artifact) + Digest::SHA256.file(artifact.file.path).hexdigest + end + end + end +end |