Skip to content

Commit d36fb5e

Browse files
committed
nightly: Generate sha1 and md5 files for builds
We missed that MTT uses the md5sums.txt and sha1sums.txt files to verify the downloaded artifacts. Start generating the two files to enable MTT to use S3 instead of the website for build files. Signed-off-by: Brian Barrett <[email protected]>
1 parent 5db6d93 commit d36fb5e

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

nightly-tarball/Builder.py

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -662,3 +662,23 @@ def remote_cleanup(self, build_history):
662662
build_history[build]['revision'])
663663
self._logger.debug("Removing data file %s" % (datafile))
664664
self._filer.delete(datafile)
665+
666+
# as a (maybe temporary?) hack, generate md5sum.txt and
667+
# sha1sum.txt files for all valid builds. Do this in
668+
# remote_cleanup rather than update_build_history so that it
669+
# gets regenerated whenever files go invalid/removed, rather
670+
# than just when new builds are created.
671+
md5sum_string = ''
672+
sha1sum_string = ''
673+
for build in build_history.keys():
674+
if not build_history[build]['valid']:
675+
continue
676+
for filename in build_history[build]['files'].keys():
677+
filedata = build_history[build]['files'][filename]
678+
md5sum_string += '%s %s\n' % (filename, filedata['md5'])
679+
sha1sum_string += '%s %s\n' % (filename, filedata['sha1'])
680+
output_base = self._config['branches'][branch_name]['output_location']
681+
self._filer.upload_from_stream(os.path.join(output_base, 'md5sums.txt'),
682+
md5sum_string)
683+
self._filer.upload_from_stream(os.path.join(output_base, 'sha1sums.txt'),
684+
sha1sum_string)

0 commit comments

Comments
 (0)