ci: retry registry push on transient timeout
All checks were successful
CI / ci (push) Successful in 6m26s
All checks were successful
CI / ci (push) Successful in 6m26s
This commit is contained in:
parent
28438dcde6
commit
79f2e8a78b
@ -73,8 +73,17 @@ jobs:
|
||||
run: |
|
||||
echo "${{ secrets.CI_TOKEN }}" | docker login 10.66.15.22:3000 -u "${{ github.repository_owner }}" --password-stdin
|
||||
docker build -t "$IMAGE:${{ steps.tag.outputs.sha }}" -t "$IMAGE:latest" .
|
||||
docker push "$IMAGE:${{ steps.tag.outputs.sha }}"
|
||||
docker push "$IMAGE:latest"
|
||||
# Registry pushes can time out on a slow blob; docker push is resumable, so retry.
|
||||
push_retry() {
|
||||
for i in 1 2 3 4 5; do
|
||||
docker push "$1" && return 0
|
||||
echo "push of $1 failed (attempt $i), retrying in 10s..."
|
||||
sleep 10
|
||||
done
|
||||
return 1
|
||||
}
|
||||
push_retry "$IMAGE:${{ steps.tag.outputs.sha }}"
|
||||
push_retry "$IMAGE:latest"
|
||||
|
||||
- name: Bump k8s image tag and commit back
|
||||
run: |
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user