From bf097b9bb776fb25ac5f80a7e8947002f3713426 Mon Sep 17 00:00:00 2001 From: Jake Howard Date: Fri, 26 Aug 2022 10:46:33 +0100 Subject: [PATCH] Tag images based on commit SHA, not branch name Branch name isn't useful for the main use case of rollbacks --- .gitlab-ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index d485cd9..65edd1f 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -46,7 +46,7 @@ build_container: services: - docker:dind variables: - IMAGE_TAG: $CI_REGISTRY_IMAGE:$CI_COMMIT_REF_SLUG + IMAGE_TAG: $CI_REGISTRY_IMAGE:$CI_COMMIT_SHA DOCKER_BUILDKIT: 1 dependencies: [] stage: test @@ -154,7 +154,7 @@ deploy_container: services: - docker:dind variables: - SRC_IMAGE_TAG: $CI_REGISTRY_IMAGE:$CI_COMMIT_REF_SLUG + SRC_IMAGE_TAG: $CI_REGISTRY_IMAGE:$CI_COMMIT_SHA DEST_IMAGE_TAG: $CI_REGISTRY_IMAGE:latest DOCKER_BUILDKIT: 1 dependencies: []