Skip to content

Commit

Permalink
Use build metadata
Browse files Browse the repository at this point in the history
  • Loading branch information
erikwilson committed Feb 23, 2021
1 parent d09bef3 commit 62ad99f
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,21 +4,27 @@ ifeq ($(ARCH),)
ARCH=$(shell go env GOARCH)
endif

BUILD_META=-build$(shell date +%Y%m%d)
ORG ?= rancher
PKG ?= github.com/kubernetes-sigs/cri-tools
SRC ?= github.com/kubernetes-sigs/cri-tools
TAG ?= v1.18.0
TAG ?= v1.18.0$(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 PKG=$(PKG) \
--build-arg SRC=$(SRC) \
--build-arg TAG=$(TAG) \
--build-arg TAG=$(TAG:$(BUILD_META)=) \
--tag $(ORG)/hardened-crictl:$(TAG) \
--tag $(ORG)/hardened-crictl:$(TAG)-$(ARCH) \
.
Expand Down

0 comments on commit 62ad99f

Please sign in to comment.