Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion .kokoro/verify-docker-images.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@

# Script to verify the presence of GraalVM docker test images tagged with the latest java-shared-config version.

set -o pipefail

# Output commands executed.
set -x

function fetch_image_names() {
imageNames="$(grep " - gcr.io/cloud-devrel-public-resources/" .cloudbuild/cloudbuild.yaml | cut -d "/" -f 3 | cut -d ":" -f 1)"
export imageNames
Expand Down Expand Up @@ -30,9 +35,10 @@ if [[ "${branchName}" == *"release-please--branches--main"* ]] && [[ ! $gitCommi
gcloud container images describe "${fullContainerName}" > /dev/null; exit_status=$?
if [[ $exit_status = 0 ]]; then
echo "Success. Found $fullContainerName."
else
exit $exit_status
Comment on lines +38 to +39
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wouldn't set -o pipefail exit with the non-zero status code? I might be missing something, but Is this check needed?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's a good question! Just tried it out in f48fb2d but unfortunately, it looks like we still need the check otherwise the script results in an exit 0 even when the command results in an error:

ERROR: (gcloud.container.images.describe) [:latest] digest must be of the form "sha256:<digest>".
+ exit_status=1
cleanup

[ID: 8899040] Command finished after 23 secs, exit value: 0

fi
done
RETURN_CODE=$?
else
echo "Skipping check for non-release and SNAPSHOT update branches"
exit 0
Expand Down