fix: retries only 10 times

This commit is contained in:
Giles Bradshaw 2020-09-24 14:57:50 +01:00
parent a8c7fae1e8
commit fc6397378f
4 changed files with 18 additions and 3 deletions

View File

@ -14,6 +14,11 @@ local config = {
registry(
config {
script: 'sh .drone/scripts/initialise-images.sh',
secrets: [
'REGISTRY_DOMAIN',
'REGISTRY_PORT',
'REGISTRY_PASSWORD'
],
},
) {
trigger +: {

View File

@ -4,6 +4,6 @@
"build": "drone jsonnet --source drone-home.jsonnet --target drone-home.yml --stream"
},
"dependencies": {
"@sigyl/jsonnet-drone": "^0.3.0"
"@sigyl/jsonnet-drone": "^0.3.1"
}
}

View File

@ -5,7 +5,12 @@ do
&& docker tag $2 $1$2 \
&& docker push $1$2 && break # substitute your command here
n=$((n+1))
if [ $n -ge 10 ]; then
echo "initialise failed"
exit 1
fi
echo "retrying..$n"
sleep 1
sleep 5
done

View File

@ -4,8 +4,13 @@ do
docker login $1 --username client --password $2 \
&& break # substitute your command here
n=$((n+1))
if [ $n -ge 10 ]; then
echo "login failed"
exit 1
fi
echo "retrying login..$n"
sleep 1
sleep 5
done
sh $(dirname $0)/initialise-image.sh $1 drone/drone:1.9.0 \