Created
November 24, 2022 13:52
-
-
Save janlauber/f8e93894ef35b81d2856c452a6809f80 to your computer and use it in GitHub Desktop.
Helm Release Script for Gitlab CI
This file contains 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
#!/bin/bash | |
# build the helm charts | |
helm package ./charts/** | |
# for each .tgz file in the charts directory, create a release | |
for f in ./*.tgz | |
do | |
# get the chart name | |
chart_name=$(basename $f) | |
# upload the chart to the helm repo | |
curl --request POST \ | |
--user gitlab-ci-token:$CI_JOB_TOKEN \ | |
--form "chart=@${chart_name}" \ | |
"${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/packages/helm/api/stable/charts" | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
.gitlab-ci.yaml
: