refactor(release): updating images names and tags

Now we publish a clean image name with a version, a version+build-day
and latest tag.
This commit is contained in:
Philippe Caseiro 2023-06-12 09:17:16 +02:00
parent d331ed66cd
commit dd030ec3fa
3 changed files with 10 additions and 10 deletions

View File

@ -3,7 +3,7 @@
################################
IMAGE_REPO := reg.cadoles.com/cadoles
IMAGE_VERSION := 0.1.0
IMAGE_VERSION ?= 0.0.1
DAY_SUFFIX_TAG ?= $(shell date +%Y%m%d)

View File

@ -3,7 +3,7 @@ FROM reg.cadoles.com/proxy_cache/library/alpine:edge
# Adding testing repo
RUN echo "https://dl-cdn.alpinelinux.org/alpine/edge/testing" >> /etc/apk/repositories
RUN apk update && apk add apache-mod-auth-openidc apache2-ssl
RUN apk update && apk add apache-mod-auth-openidc apache2-ssl bash
RUN mkdir -p /var/www/html

16
main.mk
View File

@ -7,7 +7,7 @@ IMAGES_DIR := ./files/images
define build_image
echo "Building ${IMAGE_REPO}/$1";\
docker build \
-t "${IMAGE_REPO}/$1:$2" \
-t "${IMAGE_REPO}/$1:$(IMAGE_VERSION)" \
-f ${IMAGES_DIR}/$1/$2/Dockerfile \
.
endef
@ -29,12 +29,12 @@ define install_trivy
endef
define release_image
docker tag $(IMAGE_REPO)/$1:$2 $(IMAGE_REPO)/$1:$2-$(IMAGE_VERSION)-$(DAY_SUFFIX_TAG) ; \
docker tag $(IMAGE_REPO)/$1:$2 $(IMAGE_REPO)/$1:$2-$(IMAGE_VERSION); \
docker tag $(IMAGE_REPO)/$1:$2 $(IMAGE_REPO)/$1:$2-latest ; \
docker push $(IMAGE_REPO)/$1:$2-$(IMAGE_VERSION)-$(DAY_SUFFIX_TAG) ; \
docker push $(IMAGE_REPO)/$1:$2-$(IMAGE_VERSION) ; \
docker push $(IMAGE_REPO)/$1:$2-latest
docker tag $(IMAGE_REPO)/$1:$(IMAGE_VERSION) $(IMAGE_REPO)/$1:$(IMAGE_VERSION)-$(DAY_SUFFIX_TAG) ; \
docker tag $(IMAGE_REPO)/$1:$(IMAGE_VERSION) $(IMAGE_REPO)/$1:$(IMAGE_VERSION); \
docker tag $(IMAGE_REPO)/$1:$(IMAGE_VERSION) $(IMAGE_REPO)/$1:latest ; \
docker push $(IMAGE_REPO)/$1:latest ; \
docker push $(IMAGE_REPO)/$1:$(IMAGE_VERSION) ; \
docker push $(IMAGE_REPO)/$1:$(IMAGE_VERSION)-$(DAY_SUFFIX_TAG)
endef
@ -75,4 +75,4 @@ tools/bin/bash_unit:
mkdir -p tools/bin
cd tools/bin && bash <(curl -s https://raw.githubusercontent.com/pgrange/bash_unit/master/install.sh)
##include recipes/*.mk
##include recipes/*.mk