script for manual chart upload

update-chart-readme
Rimas Mocevicius 2018-11-23 14:27:15 +00:00 committed by GitHub
parent 335e1e357f
commit 272764656d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 47 additions and 0 deletions

47
.scripts/repo-sync.sh Normal file
View File

@ -0,0 +1,47 @@
#!/bin/bash
set -e
# the repo path to this repository
REPO_URL="https://charts.keel.sh"
function gen_packages() {
echo "Packaging charts from source code"
mkdir -p temp
for d in stable/*
do
if [[ -d $d ]]
then
# Will generate a helm package per chart in a folder
echo "$d"
helm package "$d"
# shellcheck disable=SC2035
mv *.tgz temp/
fi
done
}
function index() {
echo "Fetch charts and index.yaml"
gsutil rsync gs://charts.keel.sh ./temp/
echo "Indexing repository"
if [ -f index.yaml ]; then
helm repo index --url ${REPO_URL} --merge index.yaml ./temp
else
helm repo index --url ${REPO_URL} ./temp
fi
}
function upload() {
echo "Upload charts to GCS bucket"
gsutil rsync ./temp/ gs://charts.keel.sh
}
# generate helm chart packages
gen_packages
# create index
index
# upload to GCS bucket
upload