Skip to content

Commit

Permalink
handle image push errors (#178)
Browse files Browse the repository at this point in the history
  • Loading branch information
kzadorozhny authored May 24, 2024
1 parent 247f857 commit 93544cc
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions skylib/k8s_gitops.sh.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -56,12 +56,12 @@ function async() {
}

function waitpids() {
# Wait for all of the subprocesses, failing the script if any of them failed.
if [ "${#PIDS[@]}" != 0 ]; then
for pid in ${PIDS[@]}; do
wait ${pid}
done
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
}

cd $BUILD_WORKSPACE_DIRECTORY
Expand All @@ -73,4 +73,6 @@ else
TARGET_DIR=$BUILD_WORKSPACE_DIRECTORY
fi

# make sure that the scirpt is immediately exits if any command below fails
set -o errexit
%{statements}

0 comments on commit 93544cc

Please sign in to comment.