-
Notifications
You must be signed in to change notification settings - Fork 38
Expand file tree
/
Copy pathMakefile
More file actions
35 lines (27 loc) · 817 Bytes
/
Copy pathMakefile
File metadata and controls
35 lines (27 loc) · 817 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
IMG ?= maxrocketinternet/k8s-event-logger
TAG ?= 2.0
PLATFORMS ?= linux/amd64,linux/arm64
BUILDXDRIVER ?= docker-container
WITHSBOM ?= true
.DEFAULT_GOAL := image
.PHONY: all
all: binfmt buildxbuilder image
.PHONY: binfmt
binfmt:
docker run --privileged --rm tonistiigi/binfmt --install all
.PHONY: buildxbuilder
buildxbuilder:
docker buildx create --name k8s-event-logger-builder --driver $(BUILDXDRIVER) --platform $(PLATFORMS) --bootstrap
.PHONY: image
image:
docker buildx build --builder k8s-event-logger-builder --platform $(PLATFORMS) --sbom=$(WITHSBOM) --push -t $(IMG):$(TAG) -t $(IMG):latest .
.PHONY: clean
clean:
-docker rmi $(IMG):$(TAG)
-docker buildx rm k8s-event-logger-builder
.PHONY: test
test:
go test ./...
.PHONY: integration-test
integration-test:
go test -v -run TestIntegration