Commit 867b52fb authored by Sandro Mathys's avatar Sandro Mathys
Browse files

rename branches and environments

parent c1c9c9cc
#
# Things worth knowing wrt to the pipelines aas well as the branches / environments:
#
# Staging:
# Main:
# - Runs "tests" on all pushes, i.e. it performs a clean(!) install and runs the helm chart tests.
# - If successful, it creates a tarball from the helm chart and uploads that as an artifact.
# - There's no tags, no releases and no pushes to the helm repository.
#
# Production:
# - Does NOT allow pushes. Create merge requests from staging instead.
# - Merge requests are only allowed to be merged if the staging pipeline did run successfully.
# - Does NOT run any tests (or anything else from staging).
# Release:
# - Does NOT allow pushes. Create merge requests from main instead.
# - Merge requests are only allowed to be merged if the main pipeline did run successfully.
# - Does NOT run any tests (or anything else from main).
# - Pushes the helm chart to the repository (which is in fact the GitLab built-in container registry).
# - Creates a release: a tag on the branch and a downloadable release (source code tarballs/archives).
#
# ALWAYS bump the version in chart/Chart.yaml before merging code into PRODUCTION.
# The production pipeline will not run successfully, if the the version has not been bumped.
# ALWAYS bump the version in chart/Chart.yaml before merging code into RELEASE.
# The release pipeline will not run successfully, if the the version has not been bumped.
# This is in order to not overwrite an existing version.
#
# If you need to replace an existing version for some reason, you MUST first delete the tag on
......@@ -46,14 +46,14 @@ cache:
- ".config/helm/registry.json"
stages:
# staging
# main
- prepare
- precleanup
- deploy
- verify
- postcleanup
- package
# production
# release
- upload
- release
......@@ -72,9 +72,9 @@ stages:
prepare:
stage: prepare
environment:
name: staging
name: main
only:
- staging
- main
image:
name: "${CI_REGISTRY}/maps/cicd-images/ansible:latest"
interruptible: true
......@@ -98,18 +98,18 @@ prepare:
precleanup:
stage: precleanup
environment:
name: staging
name: main
only:
- staging
- main
extends:
- .cleanup
deploy:
stage: deploy
environment:
name: staging
name: main
only:
- staging
- main
interruptible: true
script:
- kubectl --namespace "${NAMESPACE}" --server "${KUBE_APISERVER}" --token="${KUBE_TOKEN}" create secret tls shibboleth-sp-helm-chart-certs --cert="ci/sp-cert.pem" --key="ci/sp-key.pem"
......@@ -121,9 +121,9 @@ deploy:
verify:
stage: verify
environment:
name: staging
name: main
only:
- staging
- main
interruptible: true
script:
- helm test "${HELM_RELEASE}"
......@@ -135,18 +135,18 @@ verify:
postcleanup:
stage: postcleanup
environment:
name: staging
name: main
only:
- staging
- main
extends:
.cleanup
package:
stage: package
environment:
name: staging
name: main
only:
- staging
- main
interruptible: true
script:
- helm package chart
......@@ -158,9 +158,9 @@ package:
upload:
stage: upload
environment:
name: production
name: release
only:
- production
- release
interruptible: true
script:
- grep "^version:" chart/Chart.yaml | sed "s/^.*:\W*\([0-9\.]*\)$/CHART_VERSION=\"\1\"/" > ".variables.env"
......@@ -179,9 +179,9 @@ upload:
release:
stage: release
environment:
name: production
name: release
only:
- production
- release
image: registry.gitlab.com/gitlab-org/release-cli:latest
script:
- echo "Creating release ${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