diff --git a/.drone/build.sh b/.drone/build.sh index 82f6787..bc340b2 100644 --- a/.drone/build.sh +++ b/.drone/build.sh @@ -1,3 +1,3 @@ docker build guacamole-postgresql \ - -t ${REGISTRY_DOMAIN}:${REGISTRY_PORT}/guacamole-postgresql \ - --build-arg REGISTRY=${REGISTRY_DOMAIN}:${REGISTRY_PORT}/ + -t ${REGISTRY_DOMAIN}:${REGISTRY_PORT}/${NAME}/guacamole-postgresql \ + --build-arg REGISTRY=${REGISTRY_DOMAIN}:${REGISTRY_PORT}/${NAME}/ diff --git a/.drone/deploy.sh b/.drone/deploy.sh index 0e43a53..f11020f 100644 --- a/.drone/deploy.sh +++ b/.drone/deploy.sh @@ -1,4 +1,4 @@ -export LOCAL_DOCKER_REGISTRY=${REGISTRY_DOMAIN}:${REGISTRY_PORT}/ \ +export LOCAL_DOCKER_REGISTRY=${REGISTRY_DOMAIN}:${REGISTRY_PORT}/${NAME}/ \ && docker stack rm guacamole \ && echo 'sleeping...zzz' \ && sleep 60 \ diff --git a/.drone/drone-home.jsonnet b/.drone/drone-home.jsonnet index 5e24283..5da5fad 100644 --- a/.drone/drone-home.jsonnet +++ b/.drone/drone-home.jsonnet @@ -8,20 +8,22 @@ local save = import 'node_modules/@sigyl/jsonnet-drone/save.libsonnet'; local config = { registry: '', + root: '/stack/', + name: 'guacamole', }; local defs = [ { load: 'postgres:12.4', - save: 'proxy/postgres:12.4' + save: 'postgres:12.4' }, { load: 'guacamole/guacd:1.2.0', - save: 'proxy/guacamole/guacd:1.2.0', + save: 'guacamole/guacd:1.2.0', }, { load: 'guacamole/guacamole:1.2.0', - save: 'proxy/guacamole/guacamole:1.2.0', + save: 'guacamole/guacamole:1.2.0', }, ]; [ @@ -43,7 +45,6 @@ local defs = [ }, }, save(config)( - 'guacamole', defs, ) { trigger +: { @@ -56,8 +57,6 @@ local defs = [ }, }, deploy(config)( - 'guacamole', - '/stack/', [], publicSecrets, secretSecrets, diff --git a/.drone/drone-home.yml b/.drone/drone-home.yml index f11219d..4595688 100644 --- a/.drone/drone-home.yml +++ b/.drone/drone-home.yml @@ -130,6 +130,9 @@ steps: 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 /root/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" >> /root/images/guacamole/load.sh - name: guacamole/guacd:1.2.0 image: appleboy/drone-ssh:1.6.2@sha256:b801dc2cd238c192b6e99acfa7bc3f5b9a03f312bd2feb1e10b3a7a28a1b80ea @@ -146,6 +149,9 @@ steps: 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 /root/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" >> /root/images/guacamole/load.sh - name: guacamole/guacamole:1.2.0 image: appleboy/drone-ssh:1.6.2@sha256:b801dc2cd238c192b6e99acfa7bc3f5b9a03f312bd2feb1e10b3a7a28a1b80ea @@ -162,6 +168,9 @@ steps: 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 /root/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" >> /root/images/guacamole/load.sh trigger: event: diff --git a/.drone/login.sh b/.drone/login.sh deleted file mode 100644 index 982ed2d..0000000 --- a/.drone/login.sh +++ /dev/null @@ -1 +0,0 @@ -docker login ${REGISTRY_DOMAIN}:${REGISTRY_PORT} --username client --password "${REGISTRY_PASSWORD}" \ No newline at end of file diff --git a/.drone/logout.sh b/.drone/logout.sh deleted file mode 100644 index 2337c7c..0000000 --- a/.drone/logout.sh +++ /dev/null @@ -1 +0,0 @@ -docker logout ${REGISTRY_DOMAIN}:${REGISTRY_PORT} \ No newline at end of file diff --git a/.drone/pull.sh b/.drone/pull.sh index 6b74a0f..33dcbd9 100644 --- a/.drone/pull.sh +++ b/.drone/pull.sh @@ -1 +1 @@ -docker pull ${REGISTRY_DOMAIN}:${REGISTRY_PORT}/guacamole-postgresql +docker pull ${REGISTRY_DOMAIN}:${REGISTRY_PORT}/${NAME}/guacamole-postgresql diff --git a/.drone/push.sh b/.drone/push.sh index d5faf8a..5803f0f 100644 --- a/.drone/push.sh +++ b/.drone/push.sh @@ -1 +1 @@ -docker push ${REGISTRY_DOMAIN}:${REGISTRY_PORT}/guacamole-postgresql +docker push ${REGISTRY_DOMAIN}:${REGISTRY_PORT}/${NAME}/guacamole-postgresql