From 156bd2fad3e29496a04831752ed380217cbf8ee1 Mon Sep 17 00:00:00 2001 From: Giles Bradshaw Date: Fri, 23 Oct 2020 00:54:44 +0100 Subject: [PATCH] . --- .drone/drone-home.jsonnet | 3 +++ .drone/drone-home.yml | 22 +++++++++++++++++++++- 2 files changed, 24 insertions(+), 1 deletion(-) diff --git a/.drone/drone-home.jsonnet b/.drone/drone-home.jsonnet index 3c2ddf1..c301832 100644 --- a/.drone/drone-home.jsonnet +++ b/.drone/drone-home.jsonnet @@ -48,6 +48,9 @@ local defs = [ }, save(config)( defs, + [ + 'guacamole-postgresql', + ], ) { trigger +: { event +: [ diff --git a/.drone/drone-home.yml b/.drone/drone-home.yml index f99d955..1f1e7a2 100644 --- a/.drone/drone-home.yml +++ b/.drone/drone-home.yml @@ -112,8 +112,9 @@ steps: - drone_repo_name - drone_repo_namespace script: - - mkdir -p /stack/.images/guacamole + - mkdir -p /stack/.images/guacamole/built - rm -f /stack/.images/guacamole/*.* + - rm -f /stack/.images/guacamole/built/*.* - name: postgres:12.4 image: appleboy/drone-ssh:1.6.2@sha256:b801dc2cd238c192b6e99acfa7bc3f5b9a03f312bd2feb1e10b3a7a28a1b80ea @@ -172,6 +173,25 @@ steps: - echo "docker load guacamole_guacamole:1.2.0.tar" >> /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" >> /stack/.images/guacamole/load.sh +- name: guacamole-postgresql + image: appleboy/drone-ssh:1.6.2@sha256:b801dc2cd238c192b6e99acfa7bc3f5b9a03f312bd2feb1e10b3a7a28a1b80ea + settings: + envs: + - drone_tag + - drone_commit + - drone_build_number + - drone_repo_name + - drone_repo_namespace + - registry_domain + - registry_port + - 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}/stack/guacamole/guacamole-postgresql + - docker save $${REGISTRY_DOMAIN}:$${REGISTRY_PORT}/stack/guacamole/guacamole-postgresql -o /stack/.images/guacamole/built/guacamole-postgresql.tar + - echo "docker load guacamole-postgresql.tar" >> /stack/.images/guacamole/built/load.sh + - echo "docker tag $${REGISTRY_DOMAIN}:$${REGISTRY_PORT}/stack/guacamole/guacamole-postgresql /stack/DOLLAR1/guacamole-postgresql" >> /stack/.images/guacamole/built/load.sh + trigger: event: - promote