Add annotated tag build and push into makefile.
Without annotation, the TAG is empty and
action is not performed.

Signed-off-by: Petr Kotas <pkotas@redhat.com>
This commit is contained in:
Petr Kotas 2021-08-17 11:59:32 +02:00
Родитель 558fc5d024
Коммит 44f6fc55fb
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 9A2182A6A306C71D
1 изменённых файлов: 15 добавлений и 1 удалений

Просмотреть файл

@ -1,6 +1,8 @@
SHELL = /bin/bash
TAG ?= $(shell git describe --exact-match)
COMMIT = $(shell git rev-parse --short=7 HEAD)$(shell [[ $$(git status --porcelain) = "" ]] || echo -dirty)
ARO_IMAGE ?= ${RP_IMAGE_ACR}.azurecr.io/aro:$(COMMIT)
ARO_IMAGE_BASE = ${RP_IMAGE_ACR}.azurecr.io/aro
ARO_IMAGE ?= $(ARO_IMAGE_BASE):$(COMMIT)
# fluentbit version must also be updated in RP code, see pkg/util/version/const.go
FLUENTBIT_VERSION = 1.7.8-1
@ -52,6 +54,12 @@ image-aro: aro e2e.test
docker pull registry.access.redhat.com/ubi8/ubi-minimal
docker build --no-cache -f Dockerfile.aro -t $(ARO_IMAGE) .
image-aro-tag: image-aro
ifeq ($(TAG),)
$(error TAG undefined)
endif
docker tag $(ARO_IMAGE) $(ARO_IMAGE_BASE):$(TAG)
image-aro-multistage:
docker build --no-cache -f Dockerfile.aro-multistage -t $(ARO_IMAGE) .
@ -74,6 +82,12 @@ ifeq ("${RP_IMAGE_ACR}-$(BRANCH)","arointsvc-master")
docker push arointsvc.azurecr.io/aro:latest
endif
publish-image-aro-tag: image-aro-tag
ifeq ($(TAG),)
$(error TAG undefined)
endif
docker push $(ARO_IMAGE_BASE):$(TAG)
publish-image-aro-multistage: image-aro-multistage
docker push $(ARO_IMAGE)
ifeq ("${RP_IMAGE_ACR}-$(BRANCH)","arointsvc-master")