From 4d2ca6bd3a5a8ae36d6169f260983eae2cee1d93 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 --- .gitignore | 3 ++- Makefile | 27 ++++++++++++++++++++------- 2 files changed, 22 insertions(+), 8 deletions(-) diff --git a/.gitignore b/.gitignore index ddcc7ea..1ed2864 100644 --- a/.gitignore +++ b/.gitignore @@ -4,4 +4,5 @@ /bin /node_modules /.env -/tools \ No newline at end of file +/tools +.mktools/ 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