Skip to content

Commit

Permalink
lib/releaselib: Copy release artifact SHAs to SHA{256,512}SUMS files
Browse files Browse the repository at this point in the history
Signed-off-by: Stephen Augustus <saugustus@vmware.com>
  • Loading branch information
justaugustus committed Aug 17, 2019
1 parent 58b0ce8 commit 7f38586
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/common.sh
Original file line number Diff line number Diff line change
Expand Up @@ -647,7 +647,7 @@ common::sha () {
local file=$1
local algo=${2:-256}

which shasum >/dev/null 2>&1 && LANG=C shasum -a$algo $file | awk '{print $1}'
which shasum >/dev/null 2>&1 && LANG=C shasum -a$algo $file | sed 's/ .*\// /'
}

###############################################################################
Expand Down
10 changes: 9 additions & 1 deletion lib/releaselib.sh
Original file line number Diff line number Diff line change
Expand Up @@ -683,8 +683,16 @@ release::gcs::locally_stage_release_artifacts() {
common::sha $path 256 > "$path.sha256" || return 1
common::sha $path 512 > "$path.sha512" || return 1
done
}

logecho "- Writing artifact hashes to SHA256SUMS/SHA512SUMS files..."
for sha_file in "$gcs_stage"/*.sha256; do
cat "$sha_file" >> SHA256SUMS
done

for sha_file in "$gcs_stage"/*.sha512; do
cat "$sha_file" >> SHA512SUMS
done
}

###############################################################################
# Publish a new version, (latest or stable,) but only if the
Expand Down

0 comments on commit 7f38586

Please sign in to comment.