mirror of
https://github.com/balena-os/balena-supervisor.git
synced 2024-12-18 21:27:54 +00:00
Add a script to retry docker push when deploying
This commit is contained in:
parent
77ae12f0fb
commit
346e36f52b
@ -10,3 +10,4 @@ automation
|
||||
tools
|
||||
README.md
|
||||
gosuper
|
||||
retry_docker_push.sh
|
||||
|
2
Makefile
2
Makefile
@ -50,7 +50,7 @@ supervisor: gosuper
|
||||
|
||||
deploy: supervisor
|
||||
docker tag -f $(IMAGE) $(DEPLOY_REGISTRY)$(IMAGE)
|
||||
docker push $(DEPLOY_REGISTRY)$(IMAGE)
|
||||
bash retry_docker_push.sh $(DEPLOY_REGISTRY)$(IMAGE)
|
||||
|
||||
go-builder:
|
||||
-cp tools/dind/config.json ./gosuper/
|
||||
|
15
retry_docker_push.sh
Executable file
15
retry_docker_push.sh
Executable file
@ -0,0 +1,15 @@
|
||||
#!/bin/bash
|
||||
|
||||
IMAGE=$1
|
||||
retries=0
|
||||
|
||||
while [ $retries -lt 3 ]; do
|
||||
let retries=retries+1
|
||||
docker push $IMAGE
|
||||
ret=$?
|
||||
if [ "$ret" -eq "0" ]; then
|
||||
break
|
||||
fi
|
||||
done
|
||||
|
||||
exit $ret
|
Loading…
Reference in New Issue
Block a user