Commit f5653368 authored by Sandro Mathys's avatar Sandro Mathys
Browse files

upload on tag instead of separate branch

parent b405e8f1
......@@ -46,16 +46,15 @@ cache:
- ".config/helm/registry.json"
stages:
# main
# on commit to main
- prepare
- precleanup
- deploy
- verify
- postcleanup
- package
# release
# on tag
- upload
- release
.cleanup:
interruptible: true
......@@ -154,38 +153,15 @@ package:
paths:
- /builds/maps/shibboleth-sp-helm-chart/*.tgz
# if the version in Chart.yaml was increased, let's save and push a new version - otherwise, fail
upload:
stage: upload
environment:
name: release
only:
- release
variables:
- $CI_COMMIT_TAG
interruptible: true
script:
- grep "^version:" chart/Chart.yaml | sed "s/^.*:\W*\([0-9\.]*\)$/CHART_VERSION=\"\1\"/" > ".variables.env"
- source ".variables.env"
- echo "Found version ${CHART_VERSION} in Chart.yaml"
- 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
# check if this version already exists (i.e. it can be downloaded) - if so, fail, otherwise continue
- helm chart pull "cr.gitlab-int.switch.ch/maps/shibboleth-sp-helm-chart/chart/shibboleth-sp:${CHART_VERSION}" > /dev/null && ( echo "FATAL - the version in Chart.yaml already exist in the repository" >&2; exit 1 )
- 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}"
artifacts:
reports:
dotenv: .variables.env
# create a tag on the branch (and, as a side effect, create release tarballs/archives)
release:
stage: release
environment:
name: release
only:
- release
image: registry.gitlab.com/gitlab-org/release-cli:latest
script:
- echo "Creating release ${CHART_VERSION}"
release:
name: "Release ${CHART_VERSION}"
description: "Automatically created by the pipeline"
tag_name: "${CHART_VERSION}"
- helm chart save chart "cr.gitlab-int.switch.ch/maps/shibboleth-sp-helm-chart"
- helm chart push "cr.gitlab-int.switch.ch/maps/shibboleth-sp-helm-chart:${CI_COMMIT_TAG}"
......@@ -15,7 +15,7 @@ type: application
# This is the chart version. This version number should be incremented each time you make changes
# to the chart and its templates, including the app version.
# Versions are expected to follow Semantic Versioning (https://semver.org/)
version: 0.4.5
version: 0.0.0
# This is the version number of the application being deployed. This version number should be
# incremented each time you make changes to the application. Versions are not expected to
......
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