Use fixture checksum in release drill
This commit is contained in:
parent
b80bf6e9a5
commit
578c77d7c5
|
|
@ -13,8 +13,6 @@ current_commit=1111111111111111111111111111111111111111
|
|||
target_commit=2222222222222222222222222222222222222222
|
||||
release_confirmation="whoneedhelp.com:$target_commit"
|
||||
forward_confirmation="whoneedhelp.com:$target_commit:forward-only"
|
||||
mock_candidate_id="sha256:$(printf 'who-need-help-release-drill-candidate' | sha256sum | awk '{print $1}')"
|
||||
|
||||
cleanup() {
|
||||
status=$?
|
||||
trap - EXIT HUP INT TERM
|
||||
|
|
@ -62,6 +60,7 @@ printf '%s %s\n' "$bundle_hash" "$(basename -- "$bundle")" >"$bundle.sha256"
|
|||
image_archive="$fixture/output/releases/incoming/who_need_help-$target_commit-images-linux-amd64.tar.gz"
|
||||
printf 'isolated release drill image archive\n' | gzip -n >"$image_archive"
|
||||
image_hash=$(sha256sum "$image_archive" | awk '{print $1}')
|
||||
fixture_candidate_id="sha256:$image_hash"
|
||||
printf '%s %s\n' "$image_hash" "$(basename -- "$image_archive")" \
|
||||
>"$image_archive.sha256"
|
||||
image_manifest="$fixture/output/releases/incoming/who_need_help-$target_commit-images.manifest"
|
||||
|
|
@ -71,7 +70,7 @@ printf '%s\n' \
|
|||
'platform=linux/amd64' \
|
||||
'topology=compact' \
|
||||
'image_count=1' \
|
||||
"image=who-need-help:production-${target_commit:0:12}|$mock_candidate_id" \
|
||||
"image=who-need-help:production-${target_commit:0:12}|$fixture_candidate_id" \
|
||||
>"$image_manifest"
|
||||
backup="$fixture/output/backups/production/pre-release.dump"
|
||||
printf 'isolated release drill backup\n' >"$backup"
|
||||
|
|
@ -195,7 +194,7 @@ if [ "$1" = inspect ]; then
|
|||
"$MOCK_ENV_FILE"
|
||||
fi
|
||||
;;
|
||||
'{{.Image}}') printf '%s\n' "$MOCK_CANDIDATE_ID" ;;
|
||||
'{{.Image}}') printf '%s\n' "$FIXTURE_CANDIDATE_ID" ;;
|
||||
*) exit 1 ;;
|
||||
esac
|
||||
exit 0
|
||||
|
|
@ -203,7 +202,7 @@ fi
|
|||
if [ "$1" = image ] && [ "$2" = inspect ] &&
|
||||
[ "$3" = --format ]; then
|
||||
case "$4" in
|
||||
'{{.Id}}') printf '%s\n' "$MOCK_CANDIDATE_ID" ;;
|
||||
'{{.Id}}') printf '%s\n' "$FIXTURE_CANDIDATE_ID" ;;
|
||||
'{{.Os}}/{{.Architecture}}') printf 'linux/amd64\n' ;;
|
||||
*) exit 1 ;;
|
||||
esac
|
||||
|
|
@ -231,7 +230,7 @@ container_env=(
|
|||
--env "MOCK_GIT_STATE=$remote_root/git-state"
|
||||
--env "MOCK_COMMAND_LOG=$remote_root/mock-commands.log"
|
||||
--env "MOCK_ENV_FILE=$remote_root/.env"
|
||||
--env "MOCK_CANDIDATE_ID=$mock_candidate_id"
|
||||
--env "FIXTURE_CANDIDATE_ID=$fixture_candidate_id"
|
||||
--env "PATH=/mock-bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
|
||||
)
|
||||
container_mounts=(
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user