diff --git a/releasenotes/notes/multiarch-manifests-pipefail-9b860f83d0f93f1e.yaml b/releasenotes/notes/multiarch-manifests-pipefail-9b860f83d0f93f1e.yaml new file mode 100644 index 000000000..c1b685c80 --- /dev/null +++ b/releasenotes/notes/multiarch-manifests-pipefail-9b860f83d0f93f1e.yaml @@ -0,0 +1,6 @@ +--- +fixes: + - | + Fixes CI multiarch manifest creation by setting ``pipefail`` in the + manifest script. Failures from ``docker manifest create`` or + ``docker manifest push`` now fail the job even when piped to ``tee``. diff --git a/tools/multiarch-manifests.sh b/tools/multiarch-manifests.sh index 97cf3b96c..ec08c4b39 100755 --- a/tools/multiarch-manifests.sh +++ b/tools/multiarch-manifests.sh @@ -1,15 +1,16 @@ #!/usr/bin/env bash # Script used by the Image build workflow to build & push multiarch manifests. -set -ex +set -o errexit +set -o xtrace +set -o pipefail mkdir -p logs images=$(cat all-pushed-images.txt | sort | uniq) # Filter out Ubuntu and Rocky Bifrost images manifest_images=$(echo "$images" \ - | grep -E '.*-(amd64|aarch64)$' \ - | sed -E 's/-(amd64|aarch64)$//' \ + | sed -nE 's/-(amd64|aarch64)$//p' \ | sort | uniq) if [ -z "$manifest_images" ]; then