From 947658a7d8d939c10277aac2deb394e56621797b Mon Sep 17 00:00:00 2001
From: Patrick Jentsch
Date: Mon, 15 Mar 2021 14:11:23 +0100
Subject: [PATCH] Change intermediate image name in order to fix issues with
building multiple branches/tags at the same time
---
.gitlab-ci.yml | 11 ++++-------
1 file changed, 4 insertions(+), 7 deletions(-)
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 3d97cac..9ee7b2d 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -1,8 +1,5 @@
image: docker:19.03.13
-variables:
- DOCKER_TLS_CERTDIR: "/certs"
-
services:
- docker:19.03.13-dind
@@ -10,6 +7,10 @@ stages:
- build
- push
+variables:
+ DOCKER_TLS_CERTDIR: "/certs"
+ INTERMEDIATE_IMAGE_TAG: $CI_REGISTRY_IMAGE:$CI_COMMIT_REF_NAME-$CI_COMMIT_SHA
+
.reg_setup:
before_script:
- apk add --no-cache curl
@@ -28,8 +29,6 @@ build_image:
stage: build
tags:
- docker
- variables:
- INTERMEDIATE_IMAGE_TAG: $CI_REGISTRY_IMAGE:$CI_COMMIT_SHA
push_master:
extends:
@@ -47,7 +46,6 @@ push_master:
- docker
variables:
IMAGE_TAG: $CI_REGISTRY_IMAGE:latest
- INTERMEDIATE_IMAGE_TAG: $CI_REGISTRY_IMAGE:$CI_COMMIT_SHA
push_other:
extends:
@@ -68,4 +66,3 @@ push_other:
- docker
variables:
IMAGE_TAG: $CI_REGISTRY_IMAGE:$CI_COMMIT_REF_NAME
- INTERMEDIATE_IMAGE_TAG: $CI_REGISTRY_IMAGE:$CI_COMMIT_SHA