-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
42 lines (32 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
IMAGE_NAME := "linkacloud/cert-manager-webhook-k8s-dns"
IMAGE_TAG := "latest"
OUT := $(shell pwd)/_out
BIN := $(OUT)/kubebuilder/bin
KUBECTL := $(BIN)/kubectl
KIND := $(BIN)/kind
$(shell mkdir -p "$(OUT)")
TEST_DATA := testdata/k8s-dns
KIND_NAME := cert-manager-e2e
verify:
@./scripts/fetch-test-binaries.sh
$(KIND) get clusters | grep $(KIND_NAME) || $(KIND) create cluster --config=testdata/k8s-dns/kind.yaml --name $(KIND_NAME)
$(KIND) export kubeconfig --name $(KIND_NAME)
$(KUBECTL) apply -f $(TEST_DATA)/dns.linka.cloud_dnsrecords.yaml
$(KUBECTL) apply -f $(TEST_DATA)/k8s-dns.yml --wait
@TEST_ZONE_NAME=example.com. go test -v -count=1 .
$(KIND) delete cluster --name $(KIND_NAME)
clean:
$(KIND) delete cluster --name $(KIND_NAME)
build:
docker build -t "$(IMAGE_NAME):$(IMAGE_TAG)" .
push:
docker push $(IMAGE_NAME):$(IMAGE_TAG)
docker: build push
.PHONY: rendered-manifest.yaml
rendered-manifest.yaml:
helm template \
cert-manager-webhook-k8s-dns \
--set image.repository=$(IMAGE_NAME) \
--set image.tag=$(IMAGE_TAG) \
deploy/cert-manager-webhook-k8s-dns > "$(OUT)/rendered-manifest.yaml"
cp $(OUT)/rendered-manifest.yaml deploy/manifests.yaml