forked from VictoriaMetrics/helm-charts
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
98 lines (81 loc) · 3.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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
URL=https://victoriametrics.github.io/helm-charts/
HELM_IMAGE = alpine/helm:3.9.1
HELM_DOCS_IMAGE = jnorwood/helm-docs:v1.11.0
CT_IMAGE = quay.io/helmpack/chart-testing:v3.7.1
KNOWN_TARGETS=helm
HELM=helm-docker
CT=ct-docker
helm-docker:
docker run --rm --name helm-exec \
--user $(shell id -u):$(shell id -g) \
--mount type=bind,src="$(shell pwd)",dst=/helm-charts \
-w /helm-charts \
-e HELM_CACHE_HOME=/helm-charts/.helm/cache \
-e HELM_CONFIG_HOME=/helm-charts/.helm/config \
-e HELM_DATA_HOME=/helm-charts/.helm/data \
$(HELM_IMAGE) \
$(CMD)
helm-local:
helm \
$(CMD)
ct-docker:
docker run --rm --name helm-exec \
--user $(shell id -u):$(shell id -g) \
--mount type=bind,src="$(shell pwd)",dst=/helm-charts \
-w /helm-charts \
-e HELM_CACHE_HOME=/helm-charts/.helm/cache \
-e HELM_CONFIG_HOME=/helm-charts/.helm/config \
-e HELM_DATA_HOME=/helm-charts/.helm/data \
--entrypoint 'ct' \
$(CT_IMAGE) \
$(CMD)
ct-local:
ct \
$(CMD)
# Run linter for helm chart
lint:
CMD="lint charts/victoria-metrics-cluster -f hack/vmcluster-template-hack.yaml" $(MAKE) $(HELM)
CMD="lint charts/victoria-metrics-single -f hack/vmsingle-lint-hack.yaml" $(MAKE) $(HELM)
CMD="lint charts/victoria-metrics-agent -f hack/vmagent-lint-hack.yaml" $(MAKE) $(HELM)
CMD="lint charts/victoria-metrics-alert -f hack/vmalert-lint-hack.yaml" $(MAKE) $(HELM)
CMD="lint charts/victoria-metrics-gateway -f hack/vmgateway-cluster-ratelimiting-minimum.yaml" $(MAKE) $(HELM)
CMD="lint charts/victoria-metrics-auth -f hack/vmauth-lint-hack.yaml" $(MAKE) $(HELM)
CMD="lint charts/victoria-metrics-anomaly -f hack/vmanomaly-lint-hack.yaml" $(MAKE) $(HELM)
# Run template for helm charts
template:
CMD="template charts/victoria-metrics-cluster -f hack/vmcluster-template-hack.yaml" $(MAKE) $(HELM)
CMD="template charts/victoria-metrics-single -f hack/vmsingle-lint-hack.yaml" $(MAKE) $(HELM)
CMD="template charts/victoria-metrics-agent -f hack/vmagent-lint-hack.yaml" $(MAKE) $(HELM)
CMD="template charts/victoria-metrics-alert -f hack/vmalert-lint-hack.yaml" $(MAKE) $(HELM)
CMD="template charts/victoria-metrics-gateway -f hack/vmgateway-cluster-ratelimiting-minimum.yaml" $(MAKE) $(HELM)
CMD="template charts/victoria-metrics-auth -f hack/vmauth-lint-hack.yaml" $(MAKE) $(HELM)
CMD="template charts/victoria-metrics-anomaly -f hack/vmanomaly-lint-hack.yaml" $(MAKE) $(HELM)
lint-ct:
CMD="lint --config .github/ci/ct.yaml --all" $(MAKE) $(CT)
lint-ct-local:
CT="ct-local" $(MAKE) lint-ct
lint-local:
HELM="helm-local" $(MAKE) lint
template-local:
HELM="helm-local" $(MAKE) template
# Package chart into zip file
package:
CMD="dependency update charts/victoria-metrics-k8s-stack" $(MAKE) $(HELM)
CMD="package charts/* -d packages" $(MAKE) $(HELM)
# Create index file (use only for initial setup)
index:
CMD="repo index --url ${URL} ." $(MAKE) $(HELM)
init:
CMD="repo add prometheus-community https://prometheus-community.github.io/helm-charts" $(MAKE) $(HELM)
CMD="repo add grafana https://grafana.github.io/helm-charts" $(MAKE) $(HELM)
CMD="repo update" $(MAKE) $(HELM)
# Update index file add new version of package into it
merge:
CMD="repo index --url ${URL} --merge index.yaml ." $(MAKE) $(HELM)
gen-docs:
docker run --rm --name helm-docs \
--user $(shell id -u):$(shell id -g) \
--mount type=bind,src="$(shell pwd)",dst=/helm-charts \
-w /helm-charts \
$(HELM_DOCS_IMAGE) \
helm-docs