From 8f4080f8a223bfeebc141656fdc2f0bdb33e6674 Mon Sep 17 00:00:00 2001 From: Giles Bradshaw Date: Sat, 24 Oct 2020 12:19:27 +0100 Subject: [PATCH] feat: destination_registry parameter for save --- .drone/drone-home.yml | 10 ++++++---- .drone/package.json | 2 +- .drone/yarn.lock | 8 ++++---- 3 files changed, 11 insertions(+), 9 deletions(-) diff --git a/.drone/drone-home.yml b/.drone/drone-home.yml index ef6cdbf..e3f01ac 100644 --- a/.drone/drone-home.yml +++ b/.drone/drone-home.yml @@ -132,12 +132,13 @@ steps: - registry_domain - registry_port - registry_password + - destination_registry 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/drone/drone/drone:1.9.1 - docker save $${REGISTRY_DOMAIN}:$${REGISTRY_PORT}/stack/drone/drone/drone:1.9.1 -o /stack/.images/drone/drone_drone:1.9.1.tar - - echo "docker load drone_drone:1.9.1.tar" >> /stack/.images/drone/load.sh - - echo "docker tag $${REGISTRY_DOMAIN}:$${REGISTRY_PORT}/stack/drone/drone/drone:1.9.1 /stack/DOLLAR1/drone/drone:1.9.1" >> /stack/.images/drone/load.sh + - echo "docker load < drone_drone:1.9.1.tar" >> /stack/.images/drone/load.sh + - echo "docker tag $${REGISTRY_DOMAIN}:$${REGISTRY_PORT}/stack/drone/drone/drone:1.9.1 $${DESTINATION_REGISTRY}/stack/drone/drone/drone:1.9.1" >> /stack/.images/drone/load.sh - name: drone/drone-runner-docker:1.5.3 image: appleboy/drone-ssh:1.6.2@sha256:b801dc2cd238c192b6e99acfa7bc3f5b9a03f312bd2feb1e10b3a7a28a1b80ea @@ -151,12 +152,13 @@ steps: - registry_domain - registry_port - registry_password + - destination_registry 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/drone/drone/drone-runner-docker:1.5.3 - docker save $${REGISTRY_DOMAIN}:$${REGISTRY_PORT}/stack/drone/drone/drone-runner-docker:1.5.3 -o /stack/.images/drone/drone_drone-runner-docker:1.5.3.tar - - echo "docker load drone_drone-runner-docker:1.5.3.tar" >> /stack/.images/drone/load.sh - - echo "docker tag $${REGISTRY_DOMAIN}:$${REGISTRY_PORT}/stack/drone/drone/drone-runner-docker:1.5.3 /stack/DOLLAR1/drone/drone-runner-docker:1.5.3" >> /stack/.images/drone/load.sh + - echo "docker load < drone_drone-runner-docker:1.5.3.tar" >> /stack/.images/drone/load.sh + - echo "docker tag $${REGISTRY_DOMAIN}:$${REGISTRY_PORT}/stack/drone/drone/drone-runner-docker:1.5.3 $${DESTINATION_REGISTRY}/stack/drone/drone/drone-runner-docker:1.5.3" >> /stack/.images/drone/load.sh trigger: event: diff --git a/.drone/package.json b/.drone/package.json index 552964d..0f14984 100644 --- a/.drone/package.json +++ b/.drone/package.json @@ -4,6 +4,6 @@ "build": "drone jsonnet --source drone-home.jsonnet --target drone-home.yml --stream" }, "dependencies": { - "@sigyl/jsonnet-drone": "^0.4.6" + "@sigyl/jsonnet-drone": "^1.0.0" } } diff --git a/.drone/yarn.lock b/.drone/yarn.lock index 6d7babd..504fd54 100644 --- a/.drone/yarn.lock +++ b/.drone/yarn.lock @@ -12,10 +12,10 @@ resolved "https://registry.yarnpkg.com/@sigyl/jsonnet-drone-environment/-/jsonnet-drone-environment-0.0.5.tgz#9ea85e08904777bd21a3e4b30b0b91461d0285ff" integrity sha512-xVGmdMO1pOyozAWUbJm6mzKBgsLPJ+1hWnGCK3AxPkr7kkDh18hu30+TLzlcQtqq76s5jUfvJUztezsGj/mIcw== -"@sigyl/jsonnet-drone@^0.4.5": - version "0.4.5" - resolved "https://registry.yarnpkg.com/@sigyl/jsonnet-drone/-/jsonnet-drone-0.4.5.tgz#deb45b3fa837650d518b651044e993266c7386ac" - integrity sha512-s7/QHlT4YydwDPz/puR4iy7rcTl5vqR4YQmqlXCMA7VlcYPT4tC3GOb38njwZfNN4mxNa6oDKaM6eZEJX4SpiQ== +"@sigyl/jsonnet-drone@^1.0.0": + version "1.0.0" + resolved "https://registry.yarnpkg.com/@sigyl/jsonnet-drone/-/jsonnet-drone-1.0.0.tgz#943bd8a1abc8a916026944816709f5ed1d8e7ef8" + integrity sha512-ubyVC1/nAM584wTnnRBZTOP18z28Yy7SRApvSuo/3y2arngKlNI1FwOzKTFt/7L9+rNy19dRO/g0obEkyR3KmA== dependencies: "@sigyl/jsonnet-compose" "^0.0.2" "@sigyl/jsonnet-drone-environment" "0.0.5"