ci: Use eval to make retry() work for pipelines too

This commit is contained in:
LemonBoy 2020-12-04 17:31:27 +01:00
parent 2282eb1be1
commit 55838bc291

View File

@ -13,7 +13,7 @@ CMD_WAIT_TIME=10s
# We give up after retrying CMD_MAX_RETRY times. # We give up after retrying CMD_MAX_RETRY times.
retry() { retry() {
for i in $(seq 1 "$CMD_MAX_RETRY"); do for i in $(seq 1 "$CMD_MAX_RETRY"); do
"$@" && return eval "$@" && return
echo "command \"$@\" failed, retrying..." echo "command \"$@\" failed, retrying..."
sleep ${CMD_WAIT_TIME} sleep ${CMD_WAIT_TIME}
done done