From 3ee1d09752563795d972d54189ac2b77038ddb13 Mon Sep 17 00:00:00 2001 From: William Petit Date: Tue, 27 Feb 2024 17:37:47 +0100 Subject: [PATCH] chore: docker image release with new tagging scheme --- Makefile | 27 ++++++++++++++++++++------- 1 file changed, 20 insertions(+), 7 deletions(-) diff --git a/Makefile b/Makefile index f483a29..7fbe8fa 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,4 @@ -DOCKER_DATE_TAG := $(shell date --utc +%Y.%-m.%-d%-H%-M) +DOCKER_REPOSITORY ?= docker.io/bornholm YQ_VERSION ?= v4.30.4 YQ_BINARY ?= yq_linux_amd64 @@ -31,12 +31,15 @@ docker-run: --tmpfs /app/data \ fake-smtp:latest -docker-release: - docker tag fake-smtp:latest bornholm/fake-smtp:latest - docker tag fake-smtp:latest bornholm/fake-smtp:$(DOCKER_DATE_TAG) - docker login - docker push bornholm/fake-smtp:latest - docker push bornholm/fake-smtp:$(DOCKER_DATE_TAG) +docker-release: .mktools + docker tag fake-smtp:latest $(DOCKER_REPOSITORY)/fake-smtp:$(MKT_PROJECT_VERSION) + docker tag fake-smtp:latest $(DOCKER_REPOSITORY)/fake-smtp:$(MKT_PROJECT_SHORT_VERSION) + docker tag fake-smtp:latest $(DOCKER_REPOSITORY)/fake-smtp:$(MKT_PROJECT_VERSION_CHANNEL)-latest + docker tag fake-smtp:latest $(DOCKER_REPOSITORY)/fake-smtp:$(MKT_PROJECT_SHORT_VERSION_CHANNEL)-latest + docker push $(DOCKER_REPOSITORY)/fake-smtp:$(MKT_PROJECT_VERSION) + docker push $(DOCKER_REPOSITORY)/fake-smtp:$(MKT_PROJECT_SHORT_VERSION) + docker push $(DOCKER_REPOSITORY)/fake-smtp:$(MKT_PROJECT_VERSION_CHANNEL)-latest + docker push $(DOCKER_REPOSITORY)/fake-smtp:$(MKT_PROJECT_SHORT_VERSION_CHANNEL)-latest test: go test -v -race ./... @@ -65,4 +68,14 @@ clean: rm -rf vendor rm -rf bin +.PHONY: mktools +mktools: + rm -rf .mktools + curl -q https://forge.cadoles.com/Cadoles/mktools/raw/branch/master/install.sh | $(SHELL) + +.mktools: + $(MAKE) mktools + +-include .mktools/*.mk + .PHONY: lint watch build vendor tidy release \ No newline at end of file