Move helm packaging to script

This commit is contained in:
2025-10-03 23:40:06 -04:00
parent fc043fc770
commit d3ba427e8b
2 changed files with 19 additions and 18 deletions

View File

@@ -65,24 +65,7 @@ steps:
commands:
- apk add --no-cache bash coreutils git curl
- helm plugin install https://github.com/chartmuseum/helm-push
# Compute semver (strip leading "v" if present)
- |
VERSION="${DRONE_TAG#v}"; echo "Using version: $VERSION"
# Package the chart with version/appVersion = git tag (sans 'v')
- helm package "$CHART_DIR" \
--version "${VERSION}" \
--app-version "${VERSION}"
# Add the Gitea Helm repo with basic auth (stored in Helm config)
- helm repo add "${DRONE_REPO_NAME}" "https://git.itzana.me/api/packages/${DRONE_REPO_OWNER}/helm" \
--username "${GITEA_USERNAME}" \
--password "${GITEA_TOKEN}"
# Push the packaged chart to Gitea (ChartMuseum API-compatible)
- helm cm-push "telegram-scam-baiter-${VERSION}.tgz" "${DRONE_REPO_NAME}"
- hack/push-chart.sh
when:
event:
- tag

18
hack/push-chart.sh Executable file
View File

@@ -0,0 +1,18 @@
#!/bin/bash
# Compute semver (strip leading "v" if present)
VERSION="${DRONE_TAG#v}"
echo "Using version: ${VERSION}"
# Package the chart with version/appVersion = git tag (sans 'v')
helm package "${CHART_DIR}" \
--version "${VERSION}" \
--app-version "${VERSION}"
# Add the Gitea Helm repo with basic auth (stored in Helm config)
helm repo add "${DRONE_REPO_NAME}" "https://git.itzana.me/api/packages/${DRONE_REPO_OWNER}/helm" \
--username "${GITEA_USERNAME}" \
--password "${GITEA_TOKEN}"
# Push the packaged chart to Gitea (ChartMuseum API-compatible)
helm cm-push "telegram-scam-baiter-${VERSION}.tgz" "${DRONE_REPO_NAME}"