chore(ci): add publish.sh script
This commit is contained in:
parent
c863fcaa6c
commit
9c09a6f19c
1 changed files with 11 additions and 0 deletions
11
publish.sh
11
publish.sh
|
@ -12,14 +12,24 @@ ct lint # || exit 1
|
|||
for p in * ; do
|
||||
if \
|
||||
[ ! -d $p ] || \
|
||||
[ $p == template ] || \
|
||||
[ $p == docs ] || \
|
||||
[ ! -f $p/Chart.yaml ] \
|
||||
; then
|
||||
continue
|
||||
fi
|
||||
|
||||
echo "${p}:";
|
||||
lastVersion=$(oras repo tags "${HELM_REPO}/${p}" | sort --sort=version | tail -1)
|
||||
echo "last pkg: ${lastVersion}"
|
||||
v=$(dasel -f "${p}/Chart.yaml" -s version)
|
||||
echo "version: ${v}";
|
||||
if [ "${v}" == "${lastVersion}" ]; then
|
||||
echo "nothing changed"
|
||||
echo
|
||||
continue
|
||||
fi
|
||||
echo
|
||||
|
||||
echo "update docs"
|
||||
helm-docs -t ./README.md.gotmpl -t _docs.gotmpl -o README.md -g "${p}"
|
||||
|
@ -27,6 +37,7 @@ for p in * ; do
|
|||
echo "package and push helm-chart"
|
||||
helm package "${p}"
|
||||
helm push "${p}-${v}.tgz" "${HELM_REPO_URL}";
|
||||
oras tag "${HELM_REPO}/${p}:${v}" "${v%\.[0-9]*}" "${v%\.[0-9]*\.[0-9]*}" "latest"
|
||||
|
||||
echo "push to git"
|
||||
set -e
|
||||
|
|
Loading…
Add table
Reference in a new issue