-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathMakefile
51 lines (39 loc) · 1.29 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
43
44
45
46
47
48
49
50
OS ?= $(shell go env GOOS)
ARCH ?= $(shell go env GOARCH)
# not used
IMAGE_NAME := "waldner/cert-manager-webhook-he"
IMAGE_TAG := "0.0.1"
OUT := $(shell pwd)/_out
KUBE_VERSION=1.24.1
USE_SECRETS ?= false
HE_USERNAME ?= ""
HE_PASSWORD ?= ""
HE_APIKEY ?= ""
$(shell mkdir -p "$(OUT)")
export TEST_ASSET_ETCD=_test/kubebuilder/bin/etcd
export TEST_ASSET_KUBE_APISERVER=_test/kubebuilder/bin/kube-apiserver
export TEST_ASSET_KUBECTL=_test/kubebuilder/bin/kubectl
test: _test/kubebuilder
USE_SECRETS=true go test -v .
_test/kubebuilder:
curl -fsSL https://go.kubebuilder.io/test-tools/$(KUBE_VERSION)/$(OS)/$(ARCH) -o kubebuilder-tools.tar.gz
mkdir -p _test/kubebuilder
tar -xvf kubebuilder-tools.tar.gz
mv kubebuilder/bin _test/kubebuilder/
rm kubebuilder-tools.tar.gz
rm -R kubebuilder
clean: clean-kubebuilder
clean-kubebuilder:
rm -Rf _test/kubebuilder
build:
docker build -t "$(IMAGE_NAME):$(IMAGE_TAG)" .
.PHONY: rendered-manifest.yaml
rendered-manifest.yaml:
helm template \
--set image.repository=$(IMAGE_NAME) \
--set image.tag=$(IMAGE_TAG) \
--set auth.useSecrets=$(USE_SECRETS) \
--set auth.heUsername=$(HE_USERNAME) \
--set auth.hePassword=$(HE_PASSWORD) \
--set auth.heApiKey=$(HE_APIKEY) \
deploy/cert-manager-webhook-he > "$(OUT)/rendered-manifest.yaml"