Add a script to retry docker push when deploying

This commit is contained in:
Pablo Carranza Vélez 2015-09-10 14:24:26 +00:00
parent 77ae12f0fb
commit 346e36f52b
3 changed files with 17 additions and 1 deletions

View File

@ -10,3 +10,4 @@ automation
tools
README.md
gosuper
retry_docker_push.sh

View File

@ -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
View 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