Skip to content

Commit da12b9e

Browse files
committed
scope func var and change exit capture eval
1 parent b040848 commit da12b9e

2 files changed

Lines changed: 4 additions & 3 deletions

File tree

commands/run.sh

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -348,8 +348,9 @@ fi
348348

349349
if [[ "${BUILDKITE_PLUGIN_DOCKER_ALWAYS_PULL:-false}" =~ ^(true|on|1)$ ]] ; then
350350
echo "--- :docker: Pulling ${image}"
351-
if ! retry "${BUILDKITE_PLUGIN_DOCKER_PULL_RETRIES:-3}" \
352-
docker pull "${image}" ; then
351+
retry "${BUILDKITE_PLUGIN_DOCKER_PULL_RETRIES:-3}" docker pull "${image}"
352+
retry_exit_status="$?"
353+
if [ $retry_exit_status -ne 0 ] ; then
353354
echo "!!! :docker: Pull failed."
354355
exit "$retry_exit_status"
355356
fi

lib/shared.bash

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ function retry {
88
local attempts=1
99

1010
until "$@"; do
11-
retry_exit_status=$?
11+
local retry_exit_status=$?
1212
echo "Exited with $retry_exit_status"
1313
if (( retries == "0" )); then
1414
return $retry_exit_status

0 commit comments

Comments
 (0)