forked from jmcgrath207/k8s-ephemeral-storage-metrics
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
110 lines (82 loc) · 3.1 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
98
99
100
101
102
103
104
105
106
107
108
109
110
.EXPORT_ALL_VARIABLES:
.ONESHELL: # Applies to every targets in the file!
GITROOT ?= $(shell pwd)
DEPLOYMENT_NAME = ephemeral-metrics
K8S_VERSION ?= 1.27.0
## Location to install dependencies to
LOCALBIN ?= $(shell pwd)/bin
$(LOCALBIN):
mkdir -p $(LOCALBIN)
ginkgo:
test -s $(LOCALBIN)/ginkgo || GOBIN=$(LOCALBIN) go install github.com/onsi/ginkgo/v2/[email protected]
crane:
test -s $(LOCALBIN)/crane || GOBIN=$(LOCALBIN) go install github.com/google/go-containerregistry/cmd/crane@latest
.PHONY: fmt
fmt: ## Run go fmt against code.
go fmt ./...
.PHONY: vet
vet: ## Run go vet against code.
go vet ./...
helm-docs:
test -s $(LOCALBIN)/helm-docs || GOBIN=$(LOCALBIN) go install github.com/norwoodj/helm-docs/cmd/helm-docs@latest
$(LOCALBIN)/helm-docs --template-files "${GITROOT}/chart/README.md.gotmpl"
cat "${GITROOT}/Header.md" "${GITROOT}/chart/README.md" > "${GITROOT}/README.md"
test-helm-render:
helm template ./chart -f ./chart/test-values.yaml 1> /dev/null
minikube_new:
./scripts/create-minikube.sh
minikube_scale_up:
minikube node add
minikube_scale_down:
minikube node delete m02
init: fmt vet
deploy_debug: init
ENV='debug' ./scripts/deploy.sh
deploy_e2e_debug: init
ENV='e2e-debug' ./scripts/deploy.sh
deploy_local: init
./scripts/deploy.sh
deploy_observability:
ENV='observability' ./scripts/deploy.sh
deploy_test: init
ENV='test' ./scripts/deploy.sh
deploy_e2e: init test-helm-render ginkgo crane minikube_new
ENV='e2e' ./scripts/deploy.sh
deploy_e2e_dirty: init test-helm-render
ENV='e2e' ./scripts/deploy.sh
deploy_many_pods:
helm install many-pods ./tests/charts/many-pods -n many-pods --create-namespace
destroy_many_pods:
helm delete -n many-pods many-pods
release-docker:
GITHUB_TOKEN="${GITHUB_TOKEN}" VERSION="${VERSION}" ./scripts/release-docker.sh
release-helm:
cd chart
sed -i "s/tag:.*/tag: ${VERSION}/g" values.yaml
sed -i "s/version:.*/version: ${VERSION}/g" Chart.yaml
sed -i "s/appVersion:.*/appVersion: ${VERSION}/g" Chart.yaml
helm package .
helm repo index --merge index.yaml .
sed -i "s!k8s-ephemeral-storage-metrics-${VERSION}.tgz!https://github.com/jmcgrath207/k8s-ephemeral-storage-metrics/releases/download/${VERSION}/k8s-ephemeral-storage-metrics-${VERSION}.tgz!g" index.yaml
cd ..
release: release-docker release-helm helm-docs
# Prod release
# ex. make VERSION=1.10.1 release
# Prerelease Candidate
# ex. make VERSION=1.6.3-rc01 release
release-github:
# Prod release
# ex. make VERSION=1.10.1 release-github
gh repo set-default jmcgrath207/k8s-ephemeral-storage-metrics
gh release create ${VERSION} --generate-notes
gh release upload ${VERSION} "chart/k8s-ephemeral-storage-metrics-${VERSION}.tgz"
rm chart/k8s-ephemeral-storage-metrics-*.tgz
prerelease-github:
# Prerelease Candidate
# ex. make VERSION=1.6.3-rc01 prerelease-github
gh repo set-default jmcgrath207/k8s-ephemeral-storage-metrics
gh release create ${VERSION} --generate-notes --prerelease
gh release upload ${VERSION} "chart/k8s-ephemeral-storage-metrics-${VERSION}.tgz"
rm chart/k8s-ephemeral-storage-metrics-*.tgz
github_login:
gh auth login --web --scopes=read:packages,write:packages