Fix pushing of short tag for devel images

Signed-off-by: Evan Lezar <elezar@nvidia.com>
This commit is contained in:
Evan Lezar 2022-02-22 10:18:01 +02:00
parent 93ca91ac3f
commit 2e4ed47ac4
3 changed files with 10 additions and 4 deletions

View File

@ -46,6 +46,7 @@ variables:
OUT_REGISTRY_TOKEN: "${CI_REGISTRY_PASSWORD}" OUT_REGISTRY_TOKEN: "${CI_REGISTRY_PASSWORD}"
OUT_REGISTRY: "${CI_REGISTRY}" OUT_REGISTRY: "${CI_REGISTRY}"
OUT_IMAGE_NAME: "${CI_REGISTRY_IMAGE}/container-toolkit" OUT_IMAGE_NAME: "${CI_REGISTRY_IMAGE}/container-toolkit"
PUSH_MULTIPLE_TAGS: "false"
# We delay the job start to allow the public pipeline to generate the required images. # We delay the job start to allow the public pipeline to generate the required images.
when: delayed when: delayed
start_in: 30 minutes start_in: 30 minutes

View File

@ -63,7 +63,11 @@ endif
# For the default push target we also push a short tag equal to the version. # For the default push target we also push a short tag equal to the version.
# We skip this for the development release # We skip this for the development release
DEVEL_RELEASE_IMAGE_VERSION ?= devel DEVEL_RELEASE_IMAGE_VERSION ?= devel
ifneq ($(strip $(VERSION)),$(DEVEL_RELEASE_IMAGE_VERSION)) PUSH_MULTIPLE_TAGS ?= true
ifeq ($(strip $(OUT_IMAGE_VERSION)),$(DEVEL_RELEASE_IMAGE_VERSION))
PUSH_MULTIPLE_TAGS = false
endif
ifeq ($(PUSH_MULTIPLE_TAGS),true)
push-$(DEFAULT_PUSH_TARGET): push-short push-$(DEFAULT_PUSH_TARGET): push-short
endif endif

View File

@ -15,8 +15,9 @@
DOCKER_BUILD_PLATFORM_OPTIONS = --platform=linux/amd64 DOCKER_BUILD_PLATFORM_OPTIONS = --platform=linux/amd64
$(PUSH_TARGETS): push-%: $(PUSH_TARGETS): push-%:
$(DOCKER) push "$(IMAGE_NAME):$(IMAGE_TAG)" $(DOCKER) tag "$(IMAGE)" "$(OUT_IMAGE)"
$(DOCKER) push "$(OUT_IMAGE)"
push-short: push-short:
$(DOCKER) tag "$(IMAGE_NAME):$(VERSION)-$(DEFAULT_PUSH_TARGET)" "$(IMAGE_NAME):$(VERSION)" $(DOCKER) tag "$(IMAGE_NAME):$(VERSION)-$(DEFAULT_PUSH_TARGET)" "$(OUT_IMAGE_NAME):$(OUT_IMAGE_VERSION)"
$(DOCKER) push "$(IMAGE_NAME):$(VERSION)" $(DOCKER) push "$(OUT_IMAGE_NAME):$(OUT_IMAGE_VERSION)"