mirror of
https://github.com/balena-os/balena-supervisor.git
synced 2025-05-03 09:32:56 +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
|
tools
|
||||||
README.md
|
README.md
|
||||||
gosuper
|
gosuper
|
||||||
|
retry_docker_push.sh
|
||||||
|
2
Makefile
2
Makefile
@ -50,7 +50,7 @@ supervisor: gosuper
|
|||||||
|
|
||||||
deploy: supervisor
|
deploy: supervisor
|
||||||
docker tag -f $(IMAGE) $(DEPLOY_REGISTRY)$(IMAGE)
|
docker tag -f $(IMAGE) $(DEPLOY_REGISTRY)$(IMAGE)
|
||||||
docker push $(DEPLOY_REGISTRY)$(IMAGE)
|
bash retry_docker_push.sh $(DEPLOY_REGISTRY)$(IMAGE)
|
||||||
|
|
||||||
go-builder:
|
go-builder:
|
||||||
-cp tools/dind/config.json ./gosuper/
|
-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…
x
Reference in New Issue
Block a user