We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 247f857 commit 93544ccCopy full SHA for 93544cc
skylib/k8s_gitops.sh.tpl
@@ -56,12 +56,12 @@ function async() {
56
}
57
58
function waitpids() {
59
- # Wait for all of the subprocesses, failing the script if any of them failed.
60
- if [ "${#PIDS[@]}" != 0 ]; then
61
- for pid in ${PIDS[@]}; do
62
- wait ${pid}
63
- done
64
- fi
+ # Wait for all of the subprocesses, returning the exit code of the first failed process.
+ if [ "${#PIDS[@]}" != 0 ]; then
+ for pid in ${PIDS[@]}; do
+ wait ${pid} || return $?
+ done
+ fi
65
66
67
cd $BUILD_WORKSPACE_DIRECTORY
@@ -73,4 +73,6 @@ else
73
TARGET_DIR=$BUILD_WORKSPACE_DIRECTORY
74
fi
75
76
+# make sure that the scirpt is immediately exits if any command below fails
77
+set -o errexit
78
%{statements}
0 commit comments