mirror of
https://github.com/Homebrew/brew.git
synced 2025-07-14 16:09:03 +08:00
Merge pull request #19800 from Homebrew/retry-docker-upload
workflows/docker: add retry to image push
This commit is contained in:
commit
0443c627d0
13
.github/workflows/docker.yml
vendored
13
.github/workflows/docker.yml
vendored
@ -306,4 +306,15 @@ jobs:
|
||||
image_args+=("ghcr.io/homebrew/ubuntu${VERSION}@sha256:$(<"${RUNNER_TEMP}/digests/${VERSION}-arm64")")
|
||||
fi
|
||||
|
||||
docker buildx imagetools create "${tag_args[@]}" "${image_args[@]}"
|
||||
attempts=0
|
||||
until docker buildx imagetools create "${tag_args[@]}" "${image_args[@]}"; do
|
||||
attempts=$((attempts + 1))
|
||||
if [[ $attempts -ge 3 ]]; then
|
||||
echo "[$(date -u)] ERROR: Failed after 3 attempts." >&2
|
||||
exit 1
|
||||
fi
|
||||
delay=$((2 ** attempts))
|
||||
if [[ $delay -gt 15 ]]; then delay=15; fi
|
||||
echo "Push failed (attempt $attempts). Retrying in ${delay} seconds..."
|
||||
sleep ${delay}
|
||||
done
|
||||
|
Loading…
x
Reference in New Issue
Block a user