Created
May 5, 2022 09:32
-
-
Save danielhamelberg/0e63d0d17c7292e16797fd6d382dc95f to your computer and use it in GitHub Desktop.
gitlab-ci template to publish Helm chart
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # 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