Skip to content

Commit 9a9b7e7

Browse files
committed
Fail pre-exit hook if there were any failures
1 parent 9b6144e commit 9a9b7e7

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

hooks/pre-exit

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,18 @@ DIR="$(cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd)"
1111
# remove build override files
1212
rm -f "docker-compose.buildkite-${BUILDKITE_BUILD_NUMBER}-override.yml"
1313

14+
FAILURES=0
15+
1416
# clean up resources after a run command. we do this here so that it will
1517
# run after a job is cancelled
1618
if [[ -n "$(plugin_read_list RUN)" ]] && [[ "$(plugin_read_config CLEANUP "true")" == "true" ]]; then
1719
# shellcheck source=lib/run.bash
1820
. "$DIR/../lib/run.bash"
1921

2022
echo "~~~ :docker: Cleaning up after docker-compose" >&2
21-
compose_cleanup
23+
if ! compose_cleanup; then
24+
FAILURES="$?"
25+
fi
2226
fi
2327

2428
# clean up builder instances if specified

0 commit comments

Comments
 (0)