Skip to content

Instantly share code, notes, and snippets.

@danielhamelberg
Created May 5, 2022 09:32
Show Gist options
  • Select an option

  • Save danielhamelberg/0e63d0d17c7292e16797fd6d382dc95f to your computer and use it in GitHub Desktop.

Select an option

Save danielhamelberg/0e63d0d17c7292e16797fd6d382dc95f to your computer and use it in GitHub Desktop.
gitlab-ci template to publish Helm chart
# This template provides the ability to easily publish Helm charts.
.helm-publish: &helm-publish
stage: deploy
image:
name: alpine/helm
entrypoint: [""]
variables:
# Path in the repo that the helm chart is located
HELM_CHART_LOCATION: "."
script:
- apk add curl
- helm package $HELM_CHART_LOCATION
- FILENAME=$(find . -type f -name "*.tgz")
- 'curl --request POST --user gitlab-ci-token:$CI_JOB_TOKEN --form "chart=@${FILENAME}" "${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/packages/helm/api/stable/charts"'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment