-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbuild.sh
executable file
·48 lines (30 loc) · 850 Bytes
/
build.sh
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
#!/bin/bash
set -e
helm repo add stable https://kubernetes-charts.storage.googleapis.com
changes=false
mkdir -p charts
sha_root=$(git log --pretty=oneline . | head -n 1 | awk '{print $1}')
for chart in $(ls src); do
echo "Checking $chart"
sha_chart=$(git log --pretty=oneline src/$chart/ | head -n 1 | awk '{print $1}')
if [[ "$sha_chart" == "$sha_root" ]]; then
echo "Changes"
helm dependency update ./src/$chart
helm package -d charts ./src/$chart
changes=true
else
echo "No changes"
fi
done
if $changes ; then
git fetch --all
git checkout gh-pages
cp charts/index.yaml .
git checkout master
helm repo index --url https://razvvan.github.io/manotaur-charts/ --merge index.yaml .
git checkout gh-pages
mv index.yaml charts/
git add charts/
git commit -m "Chart updates"
git push
fi