forked from cert-manager/webhook-example
-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathMakefile
36 lines (28 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
IMAGE_NAME := gunstore/cert-manager-webhook-dynu
IMAGE_TAG := "latest"
OUT := $(shell pwd)/_out
$(shell mkdir -p "$(OUT)")
verify:
# replace {DYNU_APIKEY} in config.json with env var value
sed -e 's/{DYNU_APIKEY}/${DYNU_APIKEY}/' testdata/config.json.tpl > testdata/config.json
# replace {DYNU_APIKEY_B64} in secret-dynu-credentials.yaml with env var value
sed -e 's/{DYNU_APIKEY_B64}/${DYNU_APIKEY_B64}/' testdata/secret-dynu-credentials.yaml.tpl > testdata/secret-dynu-credentials.yaml
go test -v .
build:
docker build -t "$(IMAGE_NAME):$(IMAGE_TAG)" .
.PHONY: rendered-manifest.yaml
rendered-manifest.yaml:
helm template \
cert-manager-webhook-dynu \
--set image.repository=$(IMAGE_NAME) \
--set image.tag=$(IMAGE_TAG) \
deploy/cert-manager-webhook-dynu > "$(OUT)/rendered-manifest.yaml"
helm-package:
sed -e 's|{IMAGE_NAME}|${IMAGE_NAME}|;s|{IMAGE_TAG}|${IMAGE_TAG}|' deploy/cert-manager-webhook-dynu/values.yaml.tpl > deploy/cert-manager-webhook-dynu/values.yaml
cd deploy && \
helm package --version $(IMAGE_TAG) cert-manager-webhook-dynu && \
cd ..
helm-install:
-helm uninstall cert-manager-webhook-dynu
helm install cert-manager-webhook-dynu ~/dev/cert-manager-webhook-dynu/deploy/cert-manager-webhook-dynu-$(IMAGE_TAG).tgz
deploy: build helm-package helm-install