-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
55 lines (50 loc) · 2.08 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
SHELL=/bin/sh -e
CURRENT_FOLDER := "$(PWD)"
DESTINATION_FOLDER := "charts/"
# Example: make update-charts branch=main
.PHONY: update-charts
update-charts:
make update-primaza-app-chart branch=$(branch)
make update-fruits-app-chart branch=$(branch)
make update-index
# Example: make update-fruits-app-chart branch=main
.PHONY: update-fruits-app-chart
update-fruits-app-chart:
chart="fruits-app"; \
gitRepo=https://github.com/halkyonio/atomic-fruits-service; \
repoFolder=$(PWD)/repository/$$chart; \
chartFolder=$$repoFolder/target/helm/kubernetes/$$chart; \
rm -rf $$repoFolder; \
git clone $$gitRepo $$repoFolder; \
cd $$repoFolder; \
git checkout $(branch); \
mvn clean install -DskipTests; \
chartVersion=`grep '^version:' $$chartFolder/Chart.yaml | awk '{print $2}' | sed -e 's/-SNAPSHOT//g' | sed -e 's/version: //g'` ; \
cd $(CURRENT_FOLDER); \
echo Chart $$chart - $$chartVersion; \
helm package $$chartFolder --dependency-update --version $$chartVersion -d $(DESTINATION_FOLDER) ; \
rm -rf $$repoFolder; \
# Example: make update-primaza-app-chart branch=main
.PHONY: update-primaza-app-chart
update-primaza-app-chart:
chart="primaza-app"; \
gitRepo=https://github.com/halkyonio/primaza-poc; \
repoFolder=$(PWD)/repository/$$chart; \
chartFolder=$$repoFolder/app/target/helm/kubernetes/$$chart; \
rm -rf $$repoFolder; \
git clone $$gitRepo $$repoFolder; \
cd $$repoFolder; \
git checkout $(branch); \
gitCommit=`git rev-parse HEAD`; \
mvn clean install -Dgit.sha.commit=$$gitCommit -Dgithub.repo=$$gitRepo -DskipTests -Pkubernetes -Dquarkus.kubernetes.ingress.host=primaza.io; \
chartVersion=`grep '^version:' $$chartFolder/Chart.yaml | awk '{print $2}' | sed -e 's/-SNAPSHOT//g' | sed -e 's/version: //g'` ; \
cd $(CURRENT_FOLDER); \
echo Chart $$chart - $$chartVersion; \
helm package $$chartFolder --dependency-update --version $$chartVersion -d $(DESTINATION_FOLDER) ; \
rm -rf $$repoFolder; \
.PHONY: update-index
update-index:
cd $(DESTINATION_FOLDER)
rm -f index-cache.yaml
helm repo index --url https://halkyonio.github.io/helm-charts --merge index.yaml .
cd $(CURRENT_FOLDER)