forked from baarde/cert-manager-webhook-ovh
-
Notifications
You must be signed in to change notification settings - Fork 14
/
Makefile
39 lines (34 loc) · 1.37 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
IMAGE_NAME := "aureq/cert-manager-webhook-ovh"
IMAGE_TAG := "latest"
.PHONY: rendered-manifest.yaml test build
OUT := $(shell pwd)/_out
TEST_ASSET_ETCD := $(OUT)/kubebuilder/bin/etcd
TEST_ASSET_KUBE_APISERVER := $(OUT)/kubebuilder/bin/kube-apiserver
TEST_ASSET_KUBECTL := $(OUT)/kubebuilder/bin/kubectl
test:
@test -d "$(OUT)" || mkdir -p "$(OUT)"
@sh ./scripts/fetch-test-binaries.sh
TEST_ASSET_ETCD="$(TEST_ASSET_ETCD)" \
TEST_ASSET_KUBE_APISERVER="$(TEST_ASSET_KUBE_APISERVER)" \
TEST_ASSET_KUBECTL="$(TEST_ASSET_KUBECTL)" \
go test -v .
build:
@test -z "$$HTTP_PROXY" -a -z "$$HTTPS_PROXY" || docker buildx build \
--progress=plain \
--compress \
--output type=image,oci-mediatypes=true,compression=estargz,force-compression=true,push=false \
--build-arg "HTTP_PROXY=$$HTTP_PROXY" \
--build-arg "HTTPS_PROXY=$$HTTPS_PROXY" \
-t "$(IMAGE_NAME):$(IMAGE_TAG)" .
@test ! -z "$$HTTP_PROXY" -o ! -z "$$HTTPS_PROXY" || docker build \
--progress=plain \
--compress \
--output type=image,oci-mediatypes=true,compression=estargz,force-compression=true,push=false \
-t "$(IMAGE_NAME):$(IMAGE_TAG)" .
rendered-manifest.yaml:
@test -d "$(OUT)" || mkdir -p "$(OUT)"
@helm template \
cert-manager-webhook-ovh \
--set image.repository=$(IMAGE_NAME) \
--set image.tag=$(IMAGE_TAG) \
charts/cert-manager-webhook-ovh > "$(OUT)/rendered-manifest.yaml"