KubeZero/scripts/publish.sh

43 lines
1.3 KiB
Bash
Raw Normal View History

2020-05-01 15:33:41 +00:00
#!/bin/bash
set -eux
# all credits go to the argoproj Helm guys https://github.com/argoproj/argo-helm
SRCROOT="$(cd "$(dirname "$0")/.." && pwd)"
2020-08-20 14:55:49 +00:00
GIT_PUSH=${GIT_PUSH:-true}
2020-05-01 15:33:41 +00:00
rm -rf $SRCROOT/output && git clone -b gh-pages ssh://git@git.zero-downtime.net:22000/ZeroDownTime/KubeZero.git $SRCROOT/output
2020-05-06 17:23:52 +00:00
# Reset all
# rm -rf $SRCROOT/output/*tgz $SRCROOT/output/index.yaml
2020-05-01 15:33:41 +00:00
helm repo add stable https://kubernetes-charts.storage.googleapis.com
helm repo add argoproj https://argoproj.github.io/argo-helm
helm repo add jetstack https://charts.jetstack.io
helm repo add uswitch https://uswitch.github.io/kiam-helm-charts/charts/
2020-07-07 12:17:20 +00:00
helm repo update
2020-05-01 15:33:41 +00:00
for dir in $(find $SRCROOT/charts -mindepth 1 -maxdepth 1 -type d);
do
name=$(basename $dir)
if [ $(helm dep list $dir 2>/dev/null| wc -l) -gt 1 ]
then
echo "Processing chart dependencies"
2020-07-07 12:17:20 +00:00
rm -rf $dir/tmpcharts
helm dependency update --skip-refresh $dir
2020-05-01 15:33:41 +00:00
fi
echo "Processing $dir"
helm lint $dir && helm --debug package $dir
2020-05-01 15:33:41 +00:00
done
cp $SRCROOT/*.tgz output/
cd $SRCROOT/output && helm repo index .
cd $SRCROOT/output && git status
if [ "$GIT_PUSH" == "true" ]
then
cd $SRCROOT/output && git add . && git commit -m "Publish charts" && git push ssh://git@git.zero-downtime.net:22000/ZeroDownTime/KubeZero.git gh-pages
fi