forked from baarde/cert-manager-webhook-ovh
-
Notifications
You must be signed in to change notification settings - Fork 32
Expand file tree
/
Copy pathMakefile
More file actions
57 lines (46 loc) · 2.14 KB
/
Makefile
File metadata and controls
57 lines (46 loc) · 2.14 KB
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
51
52
53
54
55
56
57
IMAGE_NAME := "aureq/cert-manager-webhook-ovh"
IMAGE_TAG := "latest"
.PHONY: test build helm-test rendered-manifest.yaml install-helm-docs schema install-helm-schema
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)"
@bash ./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 buildx 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"
helm-unittest: install-helm-unittest
@helm unittest charts/cert-manager-webhook-ovh/
helm-docs: install-helm-docs
@helm-docs --chart-search-root=charts/ --template-files=./_templates.gotmpl --template-files=README.md.gotmpl --sort-values-order=file
helm-schema: install-helm-schema
@helm-schema --chart-search-root charts/cert-manager-webhook-ovh/ --add-schema-reference --keep-full-comment
install-helm-unittest:
@helm plugin list | grep ^unittest >/dev/null 2>&1 || helm plugin install https://github.com/helm-unittest/helm-unittest --verify=false
install-helm-docs:
@go install github.com/norwoodj/helm-docs/cmd/helm-docs@latest
install-helm-schema:
@go install github.com/dadav/helm-schema/cmd/helm-schema@latest