From 7973cd10b7b822a4585606956392c56b350935c1 Mon Sep 17 00:00:00 2001 From: Giles Bradshaw Date: Thu, 22 Oct 2020 23:55:57 +0100 Subject: [PATCH] . --- .drone/deploy.sh | 2 +- .drone/drone-home.jsonnet | 2 +- .drone/drone-home.yml | 31 ++++++++++++++++--------------- .drone/pull.sh | 2 +- .drone/push.sh | 2 +- 5 files changed, 20 insertions(+), 19 deletions(-) diff --git a/.drone/deploy.sh b/.drone/deploy.sh index f11020f..385fcdd 100644 --- a/.drone/deploy.sh +++ b/.drone/deploy.sh @@ -1,4 +1,4 @@ -export LOCAL_DOCKER_REGISTRY=${REGISTRY_DOMAIN}:${REGISTRY_PORT}/${NAME}/ \ +export LOCAL_DOCKER_REGISTRY=${REGISTRY_DOMAIN}:${REGISTRY_PORT}/${ROOT}/${NAME}/ \ && docker stack rm guacamole \ && echo 'sleeping...zzz' \ && sleep 60 \ diff --git a/.drone/drone-home.jsonnet b/.drone/drone-home.jsonnet index 5da5fad..fff437b 100644 --- a/.drone/drone-home.jsonnet +++ b/.drone/drone-home.jsonnet @@ -8,7 +8,7 @@ local save = import 'node_modules/@sigyl/jsonnet-drone/save.libsonnet'; local config = { registry: '', - root: '/stack/', + root: 'stack', name: 'guacamole', }; diff --git a/.drone/drone-home.yml b/.drone/drone-home.yml index e3860a8..2c8dedb 100644 --- a/.drone/drone-home.yml +++ b/.drone/drone-home.yml @@ -33,7 +33,7 @@ steps: commands: - set -e - "n=0\nwhile :\ndo\n docker login $${REGISTRY_DOMAIN}:$${REGISTRY_PORT}/ --username client --password \"$${REGISTRY_PASSWORD}\" \\\\\n && break # substitute your command here\n n=$((n+1))\n if [ $n -ge 10 ]; then\n echo \"login failed\"\n exit 1\n fi\n echo \"retrying login..$n\"\n sleep 5\ndone\n" - - "n=0\nwhile :\ndo\n docker pull postgres:12.4 \\\\\n && docker tag postgres:12.4 $${REGISTRY_DOMAIN}:$${REGISTRY_PORT}/guacamole/postgres:12.4 \\\\\n && docker push $${REGISTRY_DOMAIN}:$${REGISTRY_PORT}/guacamole/postgres:12.4 && break\n n=$((n+1))\n if [ $n -ge 10 ]; then\n echo \"initialise failed\"\n exit 1\n fi\n echo \"retrying..$n\"\n sleep 5\ndone\n" + - "n=0\nwhile :\ndo\n docker pull postgres:12.4 \\\\\n && docker tag postgres:12.4 $${REGISTRY_DOMAIN}:$${REGISTRY_PORT}/stack/guacamole/postgres:12.4 \\\\\n && docker push $${REGISTRY_DOMAIN}:$${REGISTRY_PORT}/stack/guacamole/postgres:12.4 && break\n n=$((n+1))\n if [ $n -ge 10 ]; then\n echo \"initialise failed\"\n exit 1\n fi\n echo \"retrying..$n\"\n sleep 5\ndone\n" volumes: - name: dockersock path: /var/run @@ -43,7 +43,7 @@ steps: commands: - set -e - "n=0\nwhile :\ndo\n docker login $${REGISTRY_DOMAIN}:$${REGISTRY_PORT}/ --username client --password \"$${REGISTRY_PASSWORD}\" \\\\\n && break # substitute your command here\n n=$((n+1))\n if [ $n -ge 10 ]; then\n echo \"login failed\"\n exit 1\n fi\n echo \"retrying login..$n\"\n sleep 5\ndone\n" - - "n=0\nwhile :\ndo\n docker pull guacamole/guacd:1.2.0 \\\\\n && docker tag guacamole/guacd:1.2.0 $${REGISTRY_DOMAIN}:$${REGISTRY_PORT}/guacamole/guacamole/guacd:1.2.0 \\\\\n && docker push $${REGISTRY_DOMAIN}:$${REGISTRY_PORT}/guacamole/guacamole/guacd:1.2.0 && break\n n=$((n+1))\n if [ $n -ge 10 ]; then\n echo \"initialise failed\"\n exit 1\n fi\n echo \"retrying..$n\"\n sleep 5\ndone\n" + - "n=0\nwhile :\ndo\n docker pull guacamole/guacd:1.2.0 \\\\\n && docker tag guacamole/guacd:1.2.0 $${REGISTRY_DOMAIN}:$${REGISTRY_PORT}/stack/guacamole/guacamole/guacd:1.2.0 \\\\\n && docker push $${REGISTRY_DOMAIN}:$${REGISTRY_PORT}/stack/guacamole/guacamole/guacd:1.2.0 && break\n n=$((n+1))\n if [ $n -ge 10 ]; then\n echo \"initialise failed\"\n exit 1\n fi\n echo \"retrying..$n\"\n sleep 5\ndone\n" volumes: - name: dockersock path: /var/run @@ -53,7 +53,7 @@ steps: commands: - set -e - "n=0\nwhile :\ndo\n docker login $${REGISTRY_DOMAIN}:$${REGISTRY_PORT}/ --username client --password \"$${REGISTRY_PASSWORD}\" \\\\\n && break # substitute your command here\n n=$((n+1))\n if [ $n -ge 10 ]; then\n echo \"login failed\"\n exit 1\n fi\n echo \"retrying login..$n\"\n sleep 5\ndone\n" - - "n=0\nwhile :\ndo\n docker pull guacamole/guacamole:1.2.0 \\\\\n && docker tag guacamole/guacamole:1.2.0 $${REGISTRY_DOMAIN}:$${REGISTRY_PORT}/guacamole/guacamole/guacamole:1.2.0 \\\\\n && docker push $${REGISTRY_DOMAIN}:$${REGISTRY_PORT}/guacamole/guacamole/guacamole:1.2.0 && break\n n=$((n+1))\n if [ $n -ge 10 ]; then\n echo \"initialise failed\"\n exit 1\n fi\n echo \"retrying..$n\"\n sleep 5\ndone\n" + - "n=0\nwhile :\ndo\n docker pull guacamole/guacamole:1.2.0 \\\\\n && docker tag guacamole/guacamole:1.2.0 $${REGISTRY_DOMAIN}:$${REGISTRY_PORT}/stack/guacamole/guacamole/guacamole:1.2.0 \\\\\n && docker push $${REGISTRY_DOMAIN}:$${REGISTRY_PORT}/stack/guacamole/guacamole/guacamole:1.2.0 && break\n n=$((n+1))\n if [ $n -ge 10 ]; then\n echo \"initialise failed\"\n exit 1\n fi\n echo \"retrying..$n\"\n sleep 5\ndone\n" volumes: - name: dockersock path: /var/run @@ -112,8 +112,8 @@ steps: - drone_repo_name - drone_repo_namespace script: - - mkdir -p /stack/images/guacamole - - rm -f /stack/images/guacamole/*.* + - mkdir -p /stack/.images/guacamole + - rm -f /stack/.images/guacamole/*.* - name: postgres:12.4 image: appleboy/drone-ssh:1.6.2@sha256:b801dc2cd238c192b6e99acfa7bc3f5b9a03f312bd2feb1e10b3a7a28a1b80ea @@ -129,10 +129,10 @@ steps: - registry_password script: - "n=0\nwhile :\ndo\n docker login $${REGISTRY_DOMAIN}:$${REGISTRY_PORT}/ --username client --password \"$${REGISTRY_PASSWORD}\" \\\\\n && break # substitute your command here\n n=$((n+1))\n if [ $n -ge 10 ]; then\n echo \"login failed\"\n exit 1\n fi\n echo \"retrying login..$n\"\n sleep 5\ndone\n" - - docker pull $${REGISTRY_DOMAIN}:$${REGISTRY_PORT}/guacamole/postgres:12.4 - - docker save $${REGISTRY_DOMAIN}:$${REGISTRY_PORT}/postgres:12.4 -o /stack/images/guacamole/postgres:12.4.tar + - docker pull $${REGISTRY_DOMAIN}:$${REGISTRY_PORT}/stack/guacamole/postgres:12.4 + - docker save $${REGISTRY_DOMAIN}:$${REGISTRY_PORT}/stack/guacamole/postgres:12.4 -o /stack/images/guacamole/postgres:12.4.tar - echo "docker load postgres:12.4.tar" >> /stack/images/guacamole/load.sh - - echo "docker tag $${REGISTRY_DOMAIN}:$${REGISTRY_PORT}/guacamole/postgres:12.4 DOLLAR1/postgres:12.4" >> /stack/images/guacamole/load.sh + - echo "docker tag $${REGISTRY_DOMAIN}:$${REGISTRY_PORT}/stack/guacamole/postgres:12.4 /stack/DOLLAR1/postgres:12.4" >> stackimages/guacamole/load.sh - name: guacamole/guacd:1.2.0 image: appleboy/drone-ssh:1.6.2@sha256:b801dc2cd238c192b6e99acfa7bc3f5b9a03f312bd2feb1e10b3a7a28a1b80ea @@ -148,10 +148,10 @@ steps: - registry_password script: - "n=0\nwhile :\ndo\n docker login $${REGISTRY_DOMAIN}:$${REGISTRY_PORT}/ --username client --password \"$${REGISTRY_PASSWORD}\" \\\\\n && break # substitute your command here\n n=$((n+1))\n if [ $n -ge 10 ]; then\n echo \"login failed\"\n exit 1\n fi\n echo \"retrying login..$n\"\n sleep 5\ndone\n" - - docker pull $${REGISTRY_DOMAIN}:$${REGISTRY_PORT}/guacamole/guacamole/guacd:1.2.0 - - docker save $${REGISTRY_DOMAIN}:$${REGISTRY_PORT}/guacamole/guacd:1.2.0 -o /stack/images/guacamole/guacamole_guacd:1.2.0.tar + - docker pull $${REGISTRY_DOMAIN}:$${REGISTRY_PORT}/stack/guacamole/guacamole/guacd:1.2.0 + - docker save $${REGISTRY_DOMAIN}:$${REGISTRY_PORT}/stack/guacamole/guacamole/guacd:1.2.0 -o /stack/images/guacamole/guacamole_guacd:1.2.0.tar - echo "docker load guacamole_guacd:1.2.0.tar" >> /stack/images/guacamole/load.sh - - echo "docker tag $${REGISTRY_DOMAIN}:$${REGISTRY_PORT}/guacamole/guacamole/guacd:1.2.0 DOLLAR1/guacamole/guacd:1.2.0" >> /stack/images/guacamole/load.sh + - echo "docker tag $${REGISTRY_DOMAIN}:$${REGISTRY_PORT}/stack/guacamole/guacamole/guacd:1.2.0 /stack/DOLLAR1/guacamole/guacd:1.2.0" >> stackimages/guacamole/load.sh - name: guacamole/guacamole:1.2.0 image: appleboy/drone-ssh:1.6.2@sha256:b801dc2cd238c192b6e99acfa7bc3f5b9a03f312bd2feb1e10b3a7a28a1b80ea @@ -167,10 +167,10 @@ steps: - registry_password script: - "n=0\nwhile :\ndo\n docker login $${REGISTRY_DOMAIN}:$${REGISTRY_PORT}/ --username client --password \"$${REGISTRY_PASSWORD}\" \\\\\n && break # substitute your command here\n n=$((n+1))\n if [ $n -ge 10 ]; then\n echo \"login failed\"\n exit 1\n fi\n echo \"retrying login..$n\"\n sleep 5\ndone\n" - - docker pull $${REGISTRY_DOMAIN}:$${REGISTRY_PORT}/guacamole/guacamole/guacamole:1.2.0 - - docker save $${REGISTRY_DOMAIN}:$${REGISTRY_PORT}/guacamole/guacamole:1.2.0 -o /stack/images/guacamole/guacamole_guacamole:1.2.0.tar + - docker pull $${REGISTRY_DOMAIN}:$${REGISTRY_PORT}/stack/guacamole/guacamole/guacamole:1.2.0 + - docker save $${REGISTRY_DOMAIN}:$${REGISTRY_PORT}/stack/guacamole/guacamole/guacamole:1.2.0 -o /stack/images/guacamole/guacamole_guacamole:1.2.0.tar - echo "docker load guacamole_guacamole:1.2.0.tar" >> /stack/images/guacamole/load.sh - - echo "docker tag $${REGISTRY_DOMAIN}:$${REGISTRY_PORT}/guacamole/guacamole/guacamole:1.2.0 DOLLAR1/guacamole/guacamole:1.2.0" >> /stack/images/guacamole/load.sh + - echo "docker tag $${REGISTRY_DOMAIN}:$${REGISTRY_PORT}/stack/guacamole/guacamole/guacamole:1.2.0 /stack/DOLLAR1/guacamole/guacamole:1.2.0" >> stackimages/guacamole/load.sh trigger: event: @@ -211,7 +211,7 @@ steps: command_timeout: 2m source: - . - target: /stack/guacamole + target: stackguacamole - name: wait image: alpine:3.12.0@sha256:90baa0922fe90624b05cb5766fa5da4e337921656c2f8e2b13bd3c052a0baac1 @@ -250,6 +250,7 @@ steps: - export REGISTRY_PASSWORD=$${REGISTRY_PASSWORD} - set -e - export NAME=guacamole + - export ROOT=stack - cd /stack/guacamole - "n=0\nwhile :\ndo\n docker login $${REGISTRY_DOMAIN}:$${REGISTRY_PORT}/ --username client --password \"$${REGISTRY_PASSWORD}\" \\\\\n && break # substitute your command here\n n=$((n+1))\n if [ $n -ge 10 ]; then\n echo \"login failed\"\n exit 1\n fi\n echo \"retrying login..$n\"\n sleep 5\ndone\n" - sh .drone/pull.sh diff --git a/.drone/pull.sh b/.drone/pull.sh index 33dcbd9..6228058 100644 --- a/.drone/pull.sh +++ b/.drone/pull.sh @@ -1 +1 @@ -docker pull ${REGISTRY_DOMAIN}:${REGISTRY_PORT}/${NAME}/guacamole-postgresql +docker pull ${REGISTRY_DOMAIN}:${REGISTRY_PORT}/${ROOT}/${NAME}/guacamole-postgresql diff --git a/.drone/push.sh b/.drone/push.sh index 5803f0f..18edec7 100644 --- a/.drone/push.sh +++ b/.drone/push.sh @@ -1 +1 @@ -docker push ${REGISTRY_DOMAIN}:${REGISTRY_PORT}/${NAME}/guacamole-postgresql +docker push ${REGISTRY_DOMAIN}:${REGISTRY_PORT}/${ROOT}/${NAME}/guacamole-postgresql