-
Notifications
You must be signed in to change notification settings - Fork 49
/
Copy pathMakefile
42 lines (34 loc) · 1.18 KB
/
Makefile
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
36
37
38
39
40
41
42
############################################################
# clean section
############################################################
.PHONY: clean
clean:
-rm -rf must-gather/
-rm kubeconfig
############################################################
# run section
############################################################
.PHONY: run
run: clean
./collection-scripts/gather
kubeconfig:
oc config view --minify --raw > kubeconfig
.PHONY: run-image
run-image: kubeconfig
-mkdir must-gather/
${CONTAINER_ENGINE} run -v $(PWD)/kubeconfig:/kube/config --env KUBECONFIG=/kube/config \
-v $(PWD)/must-gather:/must-gather $(IMAGE_NAME_AND_VERSION):$(TAG)
.PHONY: build-and-run-image
build-and-run-image: build-image run-image
############################################################
# build section
############################################################
CONTAINER_ENGINE ?= podman
CONTROLLER_NAME ?= $(shell cat COMPONENT_NAME)
IMG ?= $(CONTROLLER_NAME)
REGISTRY ?= quay.io/stolostron
TAG ?= latest
IMAGE_NAME_AND_VERSION ?= $(REGISTRY)/$(IMG)
.PHONY: build-image
build-image:
$(CONTAINER_ENGINE) build --platform linux/amd64 -t $(IMAGE_NAME_AND_VERSION):$(TAG) -f build/Dockerfile .