From d8d72a3ad8e971e18f9ede867c15f60c275c1c28 Mon Sep 17 00:00:00 2001 From: Giles Bradshaw Date: Thu, 24 Sep 2020 12:13:50 +0100 Subject: [PATCH] . --- .drone/drone-home.yml | 7 ++++--- .drone/lib/initialise-images.sh | 13 +++++++++++++ 2 files changed, 17 insertions(+), 3 deletions(-) diff --git a/.drone/drone-home.yml b/.drone/drone-home.yml index debb894..97ba0a2 100644 --- a/.drone/drone-home.yml +++ b/.drone/drone-home.yml @@ -30,9 +30,7 @@ steps: commands: - set -e - export REGISTRY=$${REGISTRY_DOMAIN}:$${REGISTRY_PORT}/ - - docker login $${REGISTRY} --username client --password "$${REGISTRY_PASSWORD}" - - sh .drone/lib/initialise-images.sh $${REGISTRY} - - docker logout $${REGISTRY} + - sh .drone/lib/initialise-images.sh $${REGISTRY} $${REGISTRY_PASSWORD} environment: REGISTRY_DOMAIN: from_secret: registry-domain @@ -61,6 +59,9 @@ volumes: host: path: /etc/docker/certs.d +image_pull_secrets: +- dockerconfigjson + trigger: event: - promote diff --git a/.drone/lib/initialise-images.sh b/.drone/lib/initialise-images.sh index afa7ed0..8b4706c 100644 --- a/.drone/lib/initialise-images.sh +++ b/.drone/lib/initialise-images.sh @@ -1,2 +1,15 @@ +n=0 +while : +do + docker login $1 --username client --password $2 \ + && break # substitute your command here + n=$((n+1)) + echo "retrying login..$n" + sleep 15 +done + + +docker login $1 --username client --password $2 + sh $(dirname $0)/initialise-image.sh $1 drone/drone:1.9.0 \ && sh $(dirname $0)/initialise-image.sh $1 drone/drone-runner-docker:1.5.0 \ No newline at end of file