Add a chart for the web service
All checks were successful
ci/woodpecker/push/build Pipeline was successful

This commit is contained in:
2026-05-03 20:08:26 +02:00
parent 8eca97e9bf
commit 1d78ce997c

View File

@@ -21,3 +21,29 @@ steps:
memory: 500Mi
securityContext:
privileged: true
- name: Push a helm chart
image: docker.io/alpine/helm
environment:
REGISTRY_TOKEN:
from_secret: GITEA_REGISTRY_TOKEN
CHART_PATH: ./helm/softplayer-web
privileged: true
commands:
- |-
helm registry login gitea.badhouseplants.net \
--password=$REGISTRY_TOKEN \
--username=devops-bot \
- export SHORT_SHA="$(git rev-parse --short HEAD)"
- yq e -i '.version += "+" + env(SHORT_SHA)' "$CHART_PATH/Chart.yaml"
- yq e -i ".appVersion = env(CI_COMMIT_SHA)" "$CHART_PATH/Chart.yaml"
- helm dep build "$CHART_PATH"
- helm package "$CHART_PATH" -d packages;
- export REGISTRY=$(echo oci://gitea.badhouseplants.net/$CI_REPO/helm | tr '[:upper:]' '[:lower:]')
- export CHART_NAME=$(helm show chart "$CHART_PATH" | yq .name)
- export CHART_VERSION=$(helm show chart "$CHART_PATH" | yq .version)
- |-
if helm pull $REGISTRY/$CHART_NAME:$CHART_VERSION; then
echo "Chart is found in the upstream: $CHART_NAME:$CHART_VERSION"
exit 0;
fi
helm push "./packages/$CHART_NAME-$CHART_VERSION.tgz" "$REGISTRY"