From dc6e68834224ad4a442be9fd5ff65b5d389cca93 Mon Sep 17 00:00:00 2001 From: Gabriel Augendre Date: Mon, 8 Feb 2021 15:59:35 +0100 Subject: [PATCH] Use crane to retag image remotely instead of downloading it once again --- .drone.yml | 27 +++++++++------------------ 1 file changed, 9 insertions(+), 18 deletions(-) diff --git a/.drone.yml b/.drone.yml index 8763ad1..df1944f 100644 --- a/.drone.yml +++ b/.drone.yml @@ -129,25 +129,16 @@ depends_on: - unit tests - pre-commit - build prod images -environment: - POETRY_OPTIONS: "--no-dev" steps: - - name: build final prod image - image: plugins/docker - settings: - registry: rg.fr-par.scw.cloud/crocmagnon - username: { from_secret: registry_username } - password: { from_secret: registry_password } - cache_from: - - rg.fr-par.scw.cloud/crocmagnon/blog:latest-temp - - rg.fr-par.scw.cloud/crocmagnon/blog:deps - repo: rg.fr-par.scw.cloud/crocmagnon/blog - tags: latest - build_args_from_env: - - POETRY_OPTIONS - pull_image: false - purge: false - storage_driver: overlay2 + - name: retag prod image + image: gcr.io/go-containerregistry/crane + environment: + REGISTRY: rg.fr-par.scw.cloud/crocmagnon + REGISTRY_USERNAME: { from_secret: registry_username } + REGISTRY_PASSWORD: { from_secret: registry_password } + commands: + - crane auth login -u $REGISTRY_USERNAME -p $REGISTRY_PASSWORD $REGISTRY + - crane tag rg.fr-par.scw.cloud/crocmagnon/blog:latest-temp latest when: branch: - master