2020-06-30 18:08:43 +00:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
set -e
|
|
|
|
|
|
|
|
for f in packages/*; do
|
|
|
|
if [[ -z $CHART || $CHART == $(basename -- ${f}) ]]; then
|
2020-08-02 17:27:46 +00:00
|
|
|
mkdir -p assets/$(basename -- ${f})
|
2020-06-30 18:08:43 +00:00
|
|
|
if [[ -d ${f}/overlay ]]; then
|
|
|
|
cp -R ${f}/overlay/* ${f}/charts
|
|
|
|
fi
|
2020-09-22 23:46:05 +00:00
|
|
|
version=""
|
2020-06-30 18:08:43 +00:00
|
|
|
if [[ -f ${f}/package.yaml ]]; then
|
|
|
|
version=$(yq r ${f}/charts/Chart.yaml version)
|
|
|
|
packageVersion=$(yq r ${f}/package.yaml packageVersion)
|
|
|
|
yq w -i ${f}/charts/Chart.yaml 'version' "${version}${packageVersion}"
|
|
|
|
fi
|
2020-09-22 23:46:05 +00:00
|
|
|
|
2020-08-02 17:27:46 +00:00
|
|
|
helm package ${f}/charts --destination assets/$(basename -- ${f})
|
2020-09-22 23:46:05 +00:00
|
|
|
|
|
|
|
# copy over contents to charts/ folder for browsing purpose
|
|
|
|
mkdir -p charts/$(basename -- ${f})
|
|
|
|
cp -R ${f}/charts/* charts/$(basename -- ${f})/
|
|
|
|
|
|
|
|
if [[ -d ${f}/charts-crd ]]; then
|
|
|
|
packageVersion=$(yq r ${f}/package.yaml packageVersion)
|
|
|
|
yq w -i ${f}/charts-crd/Chart.yaml 'version' "${version}${packageVersion}"
|
|
|
|
|
|
|
|
helm package ${f}/charts-crd --destination assets/$(basename -- ${f})
|
|
|
|
|
|
|
|
# copy over contents to charts/ folder for browsing purpose
|
|
|
|
mkdir -p charts/$(basename -- ${f})/charts-crd
|
|
|
|
cp -R ${f}/charts-crd/* charts/$(basename -- ${f})/charts-crd
|
|
|
|
fi
|
|
|
|
helm repo index --merge ./assets/index.yaml --url assets assets
|
2020-06-30 18:08:43 +00:00
|
|
|
fi
|
|
|
|
done
|
|
|
|
|
2020-09-22 23:46:05 +00:00
|
|
|
cp ./assets/index.yaml .
|