flux-charts/publish.sh

39 lines
734 B
Bash
Executable file

#/bin/sh
HELM_REPO=${HELM_REPO:-codeberg.org/wrenix/flux-charts}
HELM_REPO_URL="oci://${HELM_REPO}"
COMMIT_SCOPE=${2:-fix}
COMMIT_MESSAGE=${1:-"update appVersion"}
ct lint # || exit 1
for p in * ; do
if \
[ ! -d $p ] || \
[ ! -f $p/Chart.yaml ] \
; then
continue
fi
echo "${p}:";
v=$(dasel -f "${p}/Chart.yaml" -s version)
echo "version: ${v}";
echo "update docs"
helm-docs -t ./README.md.gotmpl -t _docs.gotmpl -o README.md -g "${p}"
echo "package and push helm-chart"
helm package "${p}"
helm push "${p}-${v}.tgz" "${HELM_REPO_URL}";
echo "push to git"
set -e
git add "${p}/"
git commit -m "${COMMIT_SCOPE}(${p}): ${COMMIT_MESSAGE}"
git push origin main;
set +e
echo
done