Skip to content

Commit

Permalink
fixup! Improve & rename main build-push script.
Browse files Browse the repository at this point in the history
  • Loading branch information
cevich committed Sep 18, 2023
1 parent 21bae21 commit bf6acef
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion build-push/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ set -eo pipefail
SCRIPT_DIRPATH=$(dirname $(realpath "${BASH_SOURCE[0]}"))
source $SCRIPT_DIRPATH/../lib.sh

req_env_vars CIRRUS_CI
req_env_vars CIRRUS_CI CIRRUS_CHANGE_IN_REPO

# No need to test if image wasn't built
if TARGET_NAME=build-push skip_on_pr_label; then exit 0; fi
Expand Down Expand Up @@ -138,6 +138,13 @@ verify_built_images() {
_fltr='.[].Config.Labels."org.opencontainers.image.revision"'
img_rev=$(podman inspect $_fqin:$test_tag | jq -r -e "$_fltr")
showrun test "$img_rev" == "$TEST_REVISION"

msg "Testing image $_fqin:$test_tag built.by.commit label"
_fltr='.[].Config.Labels."built.by.commit"'
img_bbc=$(podman inspect $_fqin:$test_tag | jq -r -e "$_fltr")
# Checked at beginning of script
# shellcheck disable=SC2154
showrun test "$img_bbc" == "$CIRRUS_CHANGE_IN_REPO"
done
}

Expand Down

0 comments on commit bf6acef

Please sign in to comment.