From d1c0aea697245a49ef7c6a3804995983513d640b Mon Sep 17 00:00:00 2001 From: Manuel Buil Date: Wed, 10 Mar 2021 12:31:43 +0100 Subject: [PATCH] Add build date to the tag This aligns with other image-build- repos Signed-off-by: Manuel Buil --- Makefile | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 9c9598c..8c4b4c9 100644 --- a/Makefile +++ b/Makefile @@ -4,18 +4,24 @@ ifeq ($(ARCH),) ARCH=$(shell go env GOARCH) endif +BUILD_META=-build$(shell date +%Y%m%d) ORG ?= rancher -TAG ?= v3.6 +TAG ?= v3.6$(BUILD_META) ifneq ($(DRONE_TAG),) TAG := $(DRONE_TAG) endif +ifeq (,$(filter %$(BUILD_META),$(TAG))) +$(error TAG needs to end with build metadata: $(BUILD_META)) +endif + .PHONY: image-build image-build: docker build \ + --pull \ --build-arg ARCH=$(ARCH) \ - --build-arg TAG=$(TAG) \ + --build-arg TAG=$(TAG:$(BUILD_META)=) \ --tag $(ORG)/hardened-multus-cni:$(TAG) \ --tag $(ORG)/hardened-multus-cni:$(TAG)-$(ARCH) \ .