From 9143a4e12ee030ce1641d7ddf3fb9b8be099f7d4 Mon Sep 17 00:00:00 2001 From: Giles Bradshaw Date: Thu, 22 Oct 2020 17:02:43 +0100 Subject: [PATCH] . --- .drone/scripts/initialise-image.sh | 15 +++++++++++++++ .drone/scripts/initialise-images.sh | 3 +++ 2 files changed, 18 insertions(+) create mode 100644 .drone/scripts/initialise-image.sh create mode 100644 .drone/scripts/initialise-images.sh diff --git a/.drone/scripts/initialise-image.sh b/.drone/scripts/initialise-image.sh new file mode 100644 index 0000000..5692e04 --- /dev/null +++ b/.drone/scripts/initialise-image.sh @@ -0,0 +1,15 @@ +n=0 +while : +do + docker pull $2 \ + && 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 5 +done + diff --git a/.drone/scripts/initialise-images.sh b/.drone/scripts/initialise-images.sh new file mode 100644 index 0000000..585200c --- /dev/null +++ b/.drone/scripts/initialise-images.sh @@ -0,0 +1,3 @@ +sh $(dirname $0)/login.sh $1 "$2" \ +&& sh $(dirname $0)/initialise-image.sh $1 portainer/portainer-ce:2.0.0-alpine@sha256:5555e1538aa4bc56d7ae85787278e4b972573b205e2ae260717ef17985e0e24f \ +&& sh $(dirname $0)/initialise-image.sh $1 portainer/agent:2.0.0@sha256:8f994457bc32480bff351f0b1d371557238e69f5902037addfe76fa7bd930b9d \