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

improve tagging/releasing

parent d6fe4517
......@@ -30,7 +30,7 @@ stages:
- postcleanup
- package
- upload
- tag
- release
.cleanup:
interruptible: true
......@@ -153,24 +153,31 @@ upload staging:
- staging
interruptible: true
script:
- chart_version=$(grep "^version:" chart/Chart.yaml | sed "s/^.*:\W*//")
- echo "Found version ${chart_version} in Chart.yaml"
- 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 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}"
- helm chart push "cr.gitlab-int.switch.ch/maps/shibboleth-sp-helm-chart/chart/shibboleth-sp:${CHART_VERSION}"
artifacts:
reports:
dotenv: .variables.env
tag staging:
stage: tag
release staging:
stage: release
environment:
name: staging
only:
- staging
needs:
- job: upload staging
artifacts: true
image: registry.gitlab.com/gitlab-org/release-cli:latest
script:
- chart_version=$(grep "^version:" chart/Chart.yaml | sed "s/^.*:\W*//")
- echo "Creating release ${CHART_VERSION}"
release:
name: "Release ${chart_version}"
name: "Release ${CHART_VERSION}"
description: "Created by the pipeline"
tag_name: "${chart_version}"
tag_name: "${CHART_VERSION}"
......@@ -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.2.2
version: 0.2.3
# 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