Commit 99366b96 authored by Sandro Mathys's avatar Sandro Mathys
Browse files

only push if new version

parent 312ee5e7
......@@ -140,7 +140,6 @@ package production:
- .package
# TODO: only run this in production
# TODO: only push if $chart_version is > last pushed version
# TODO: add tag to branch?
upload staging:
stage: upload
......@@ -152,5 +151,7 @@ upload staging:
script:
- echo "${SHIBBOLETH_SP_HELM_CHART_REGISTRY_TOKEN}" | helm registry login "${CI_REGISTRY}/maps/shibboleth-sp-helm-chart/" -u "gitlab-ci-shibboleth-sp-helm-chart" --password-stdin
- chart_version=$(grep "^version:" chart/Chart.yaml | sed "s/^.*:\W*//")
# check if this version already exists - if so, nothing more to do
- helm chart pull "cr.gitlab-int.switch.ch/maps/shibboleth-sp-helm-chart/chart/shibboleth-sp:${chart_version}" > /dev/null && exit 0
- helm chart save chart "cr.gitlab-int.switch.ch/maps/shibboleth-sp-helm-chart/chart/shibboleth-sp"
- helm chart push "cr.gitlab-int.switch.ch/maps/shibboleth-sp-helm-chart/chart/shibboleth-sp:${chart_version}"
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment