Skip to content
Snippets Groups Projects
Verified Commit 568eef6c authored by Maarten de Waard's avatar Maarten de Waard :angel:
Browse files

fix helm_package template for repos that do not use main for the default branch

parent 5fd9fd4d
No related branches found
No related tags found
No related merge requests found
...@@ -49,14 +49,14 @@ package-chart: ...@@ -49,14 +49,14 @@ package-chart:
extends: extends:
- .chart_release_rules - .chart_release_rules
# Push helm chart. Charts on the `main` branch are pushed to `stable`, others # Push helm chart. Charts on the default branch are pushed to `stable`, others
# are pushed to the `unstable` channel. # are pushed to the `unstable` channel.
release-helm: release-helm:
image: "rancher/curlimages-curl:7.73.0" image: "rancher/curlimages-curl:7.73.0"
stage: release-helm-chart stage: release-helm-chart
script: script:
- cd ${CHART_DIR:-"."} - cd ${CHART_DIR:-"."}
- if [ "$CI_COMMIT_BRANCH" == "main" ]; then export HELM_CHANNEL='stable'; else export HELM_CHANNEL='unstable'; fi - if [ "$CI_COMMIT_BRANCH" == "$CI_DEFAULT_BRANCH" ]; then export HELM_CHANNEL='stable'; else export HELM_CHANNEL='unstable'; fi
- export CHART_FILE=$(ls ${CHART_NAME}-*.tgz) - export CHART_FILE=$(ls ${CHART_NAME}-*.tgz)
- curl --fail --request POST --user gitlab-ci-token:$CI_JOB_TOKEN --form "chart=@${CHART_FILE}" "${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/packages/helm/api/${HELM_CHANNEL}/charts" - curl --fail --request POST --user gitlab-ci-token:$CI_JOB_TOKEN --form "chart=@${CHART_FILE}" "${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/packages/helm/api/${HELM_CHANNEL}/charts"
extends: extends:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment