From ff444eebd4cb529b6f0ce6dfcb12cbccdbc279e1 Mon Sep 17 00:00:00 2001 From: Jade Abraham Date: Wed, 4 Sep 2024 10:52:59 -0700 Subject: [PATCH] force an error when a command in the package builds fails Signed-off-by: Jade Abraham --- util/cron/create_release_aptrpm.bash | 3 +++ util/packaging/common/build_helpers.sh | 4 ++-- util/packaging/common/test_package.py | 1 + 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/util/cron/create_release_aptrpm.bash b/util/cron/create_release_aptrpm.bash index 7c5ac60c9a1d..217c2f9ee4b4 100755 --- a/util/cron/create_release_aptrpm.bash +++ b/util/cron/create_release_aptrpm.bash @@ -31,6 +31,9 @@ source $CWD/functions.bash export CHPL_HOME=$(cd $CWD/../.. ; pwd) log_info "Setting CHPL_HOME to: ${CHPL_HOME}" +# if any errors occur, this script should fail +set -e + source $CHPL_HOME/util/packaging/common/build_helpers.sh # if using a local tarball, copy it to the expected location diff --git a/util/packaging/common/build_helpers.sh b/util/packaging/common/build_helpers.sh index 79d58ace1810..1c53d871a1bd 100644 --- a/util/packaging/common/build_helpers.sh +++ b/util/packaging/common/build_helpers.sh @@ -128,10 +128,10 @@ __test_package() { python3 $CHPL_HOME/util/packaging/common/test_package.py $@ } __test_all_packages() { - for deb in $(find $CHPL_HOME/util/packaging/apt/build -name '*.deb'); do + for deb in $(set +e && find $CHPL_HOME/util/packaging/apt/build -name '*.deb'); do __test_package $deb done - for rpm in $(find $CHPL_HOME/util/packaging/rpm/build -name '*.rpm'); do + for rpm in $(set +e && find $CHPL_HOME/util/packaging/rpm/build -name '*.rpm'); do __test_package $rpm done } diff --git a/util/packaging/common/test_package.py b/util/packaging/common/test_package.py index a04070f5c2e7..9ae425e89a3b 100755 --- a/util/packaging/common/test_package.py +++ b/util/packaging/common/test_package.py @@ -128,6 +128,7 @@ def docker_build_image( "docker", "buildx", "build", + "--load", "--platform", platform, "-t",