forked from kmorning/cert-manager-webhook-desec
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
35 lines (26 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
IMAGE_NAME := "kmorning/cert-manager-webhook-desec"
IMAGE_TAG := "latest"
OUT := $(shell pwd)/_out
KUBEBUILDER_VERSION=2.3.1
KUBEBUILDER_URL=https://github.com/kubernetes-sigs/kubebuilder/releases/download/v$(KUBEBUILDER_VERSION)/kubebuilder_$(KUBEBUILDER_VERSION)_linux_amd64.tar.gz
KUBEBUILDER_TGZ=$(OUT)/kubebuilder/kubebuilder_$(KUBEBUILDER_VERSION)_linux_amd64.tar.gz
KUBEBUILDER_BIN=$(OUT)/kubebuilder/bin
$(shell mkdir -p "$(KUBEBUILDER_BIN)")
$(KUBEBUILDER_TGZ):
curl -sfL $(KUBEBUILDER_URL) -o $(KUBEBUILDER_TGZ)
prepare: $(KUBEBUILDER_TGZ)
tar xvzf $(KUBEBUILDER_TGZ) --strip-components=1 -C _out/kubebuilder
$(KUBEBUILDER_BIN)/etcd: prepare
$(KUBEBUILDER_BIN)/kube-apiserver: prepare
$(KUBEBUILDER_BIN)/kubebuilder: prepare
$(KUBEBUILDER_BIN)/kubectl: prepare
test: $(KUBEBUILDER_BIN)/etcd $(KUBEBUILDER_BIN)/kube-apiserver $(KUBEBUILDER_BIN)/kubebuilder $(KUBEBUILDER_BIN)/kubectl
go test -v .
build:
docker build -t "$(IMAGE_NAME):$(IMAGE_TAG)" .
.PHONY: rendered-manifest.yaml
rendered-manifest.yaml:
helm template desec-webhook \
--set image.repository=$(IMAGE_NAME) \
--set image.tag=$(IMAGE_TAG) \
deploy/desec-webhook > "$(OUT)/rendered-manifest.yaml"