Skip to content

Commit

Permalink
Force a build script error when a subcommand fails in packaging builds (
Browse files Browse the repository at this point in the history
#25873)

Forces the packaging builds to exit with an error if an error occurs in
one of the invoked scripts.

This also adds a missing flag to the test package script.

[Reviewed by @tzinsky]
  • Loading branch information
jabraham17 authored Sep 4, 2024
2 parents 0bb9223 + ff444ee commit 6ab429c
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
3 changes: 3 additions & 0 deletions util/cron/create_release_aptrpm.bash
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions util/packaging/common/build_helpers.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
1 change: 1 addition & 0 deletions util/packaging/common/test_package.py
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,7 @@ def docker_build_image(
"docker",
"buildx",
"build",
"--load",
"--platform",
platform,
"-t",
Expand Down

0 comments on commit 6ab429c

Please sign in to comment.