From 9900fd121e7986312bb62a4479b5907ad6def0fb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jean-Fran=C3=A7ois=20Roche?= Date: Mon, 12 Dec 2022 11:26:35 +0100 Subject: [PATCH] Stop if one of the build fails Using process substitution doesn't handle errors. Check that we have the expected build assets before we continue. --- build-images.sh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/build-images.sh b/build-images.sh index 54e1c5f..ae54dea 100755 --- a/build-images.sh +++ b/build-images.sh @@ -43,7 +43,10 @@ main() { build_kexec_bundle "$tag" "$arch" "$tmp" build_netboot_image "$tag" "$arch" "$tmp" ) - + if [ ! "${#assets[@]}" -eq "3" ]; then + echo "Missing build asset" + exit 1 + fi for asset in "${assets[@]}"; do pushd "$(dirname "$asset")" sha256sum "$(basename "$asset")" >> "$TMP/sha256sums"