diff --git a/scripts/retry-docker-build.sh b/scripts/retry-docker-build.sh index 9413517..cce2b70 100644 --- a/scripts/retry-docker-build.sh +++ b/scripts/retry-docker-build.sh @@ -16,10 +16,13 @@ fi attempt=1 while true; do echo "== docker build attempt ${attempt}/${MAX}: $*" - if "$@"; then + set +e + "$@" + code=$? + set -e + if (( code == 0 )); then exit 0 fi - code=$? if (( attempt >= MAX )); then echo "== all ${MAX} attempts failed (last exit ${code})" exit "${code}"