fix(ci): add publish script with lint, tag and helm package+push
This commit is contained in:
parent
2c72bd62ae
commit
5b4621dc44
3 changed files with 75 additions and 0 deletions
1
.gitignore
vendored
Normal file
1
.gitignore
vendored
Normal file
|
@ -0,0 +1 @@
|
|||
/*.tgz
|
26
README.adoc
Normal file
26
README.adoc
Normal file
|
@ -0,0 +1,26 @@
|
|||
= helm-charts
|
||||
|
||||
== Usage
|
||||
|
||||
Helm must be installed and setup to your kubernetes cluster to use the charts.
|
||||
Refer to Helm's https://helm.sh/docs[documentation] to get started.
|
||||
Once Helm has been set up correctly, fetch the charts as follows:
|
||||
|
||||
[source,bash]
|
||||
----
|
||||
helm pull oci://codeberg.org/wrenix/helm-charts/<chart>
|
||||
----
|
||||
|
||||
You can install a chart release using the following command:
|
||||
|
||||
[source,bash]
|
||||
----
|
||||
helm install <release> oci://codeberg.org/wrenix/helm-charts/<chart> --values values.yaml
|
||||
----
|
||||
|
||||
To uninstall a chart release use `helm`'s delete command:
|
||||
|
||||
[source,bash]
|
||||
----
|
||||
helm uninstall <release>
|
||||
----
|
48
publish.sh
Executable file
48
publish.sh
Executable file
|
@ -0,0 +1,48 @@
|
|||
#/bin/sh
|
||||
|
||||
HELM_REPO=${HELM_REPO:-oci://codeberg.org/wrenix/helm-charts}
|
||||
|
||||
for p in * ; do
|
||||
if [ ! -d $p ]; then
|
||||
continue;
|
||||
fi
|
||||
|
||||
echo "${p}:";
|
||||
|
||||
# last pkg
|
||||
lastTag=$(git tag -l "${p}-v*" | tail -1)
|
||||
lastVersion=${lastTag#${p}-v}
|
||||
echo "last pkg: ${lastVersion}"
|
||||
|
||||
# Chart version
|
||||
v=$(dasel -f "${p}/Chart.yaml" -s version)
|
||||
echo "version: ${v}";
|
||||
|
||||
# should be increased?
|
||||
tag="${p}-v${v}"
|
||||
# check if a old version exists
|
||||
if [ -n $lastTag ]; then
|
||||
|
||||
# check if changes since new version happen
|
||||
changes=$(git diff "${lastTag}" -- "${p}" | wc -l);
|
||||
if [ "$changes" -gt "0" ]; then
|
||||
# check / lint if version was increased correct
|
||||
if [ "$tag" == "$lastTag" ]; then
|
||||
echo "changed helmchart should create new pkg"
|
||||
echo $(git diff "${lastTag}" -- "${p}" | wc -l);
|
||||
exit 1
|
||||
fi
|
||||
else
|
||||
echo "nothing todo"
|
||||
echo
|
||||
continue;
|
||||
fi
|
||||
fi
|
||||
helm package "${p}"
|
||||
helm push "${p}-${v}.tgz" "${HELM_REPO}";
|
||||
|
||||
git tag "${tag}" --no-sign;
|
||||
git push --tags;
|
||||
|
||||
echo
|
||||
done
|
Loading…
Add table
Reference in a new issue