forked from Mailu/helm-charts
-
Notifications
You must be signed in to change notification settings - Fork 0
/
pack_chart.sh
executable file
·48 lines (40 loc) · 1.31 KB
/
pack_chart.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
47
48
#!/bin/sh
set -e
# 1st detect helm downloaded by ci
if [ -x "helm3" ]; then
HELM3"$(pwd)/helm3"
echo "Found helm v3 at ${HELM}"
fi
if [ -z "${HELM}" ]; then
set +e
HELM=$( which helm )
if [ -z "${HELM}" ]; then
echo "Command helm not found!"
exit 1
fi
if ${HELM} version -c | grep -e 'Version:"v3.' > /dev/null; then
HELM3="${HELM}"
echo "Found helm v3 at ${HELM3}"
else
echo "Unsuported helm version: $(${HELM} version -c)"
exit 1
fi
set -e
fi
echo "Running helm lint"
${HELM} lint --strict --values mailu/helm-lint-values.yaml mailu
echo "Cloning gh-pages"
rm -rf gh-pages
git clone --single-branch --branch gh-pages https://github.com/Mailu/helm-charts.git gh-pages
( cd gh-pages && git remote set-url origin git@github.com:Mailu/helm-charts.git)
echo "Packing helm chart"
${HELM} package mailu -d gh-pages
echo "Updating repo index"
${HELM} repo index --url https://mailu.github.io/helm-charts/ gh-pages
echo "Updating gh-pages html"
( cd gh-pages && ./index.html.sh > index.html )
echo "Rendering helm chart to yaml"
VERSION=$( grep mailu/Chart.yaml -e '^version:' | awk '{ print $2 }' )
mkdir -p gh-pages/yaml
rm -rf gh-pages/yaml/${VERSION}
${HELM} template mailu --values mailu/helm-lint-values.yaml --release-name mailu --namespace mailu --output-dir gh-pages/yaml/${VERSION}