Commit 8310164f authored by Sandro Mathys's avatar Sandro Mathys
Browse files

place some jobs in production

parent b6f5c206
......@@ -23,12 +23,14 @@ cache:
- ".config/helm/registry.json"
stages:
# staging
- prepare
- precleanup
- deploy
- verify
- postcleanup
- package
# production
- upload
- release
......@@ -44,7 +46,7 @@ stages:
- kubectl --namespace "${NAMESPACE}" --server "${KUBE_APISERVER}" --token="${KUBE_TOKEN}" delete rolebinding shibboleth-sp-helm-chart-sealer-keys-nanny 2>&1 || true
- kubectl --namespace "${NAMESPACE}" --server "${KUBE_APISERVER}" --token="${KUBE_TOKEN}" delete serviceaccount shibboleth-sp-helm-chart-sealer-keys-nanny 2>&1 || true
prepare staging:
prepare:
stage: prepare
environment:
name: staging
......@@ -70,7 +72,7 @@ prepare staging:
# just in case there's some left overs for some reason - because if so, the next job will fail
# we always want to perform an install (rather than an upgrade) in order to ensure the pre-install hooks work
precleanup staging:
precleanup:
stage: precleanup
environment:
name: staging
......@@ -79,7 +81,7 @@ precleanup staging:
extends:
- .cleanup
deploy staging:
deploy:
stage: deploy
environment:
name: staging
......@@ -93,7 +95,7 @@ deploy staging:
# remove from cache
- rm -f "ci/sp-key.pem"
verify staging:
verify:
stage: verify
environment:
name: staging
......@@ -107,7 +109,7 @@ verify staging:
# we always want to perform an install (rather than an upgrade) in order to ensure the pre-install hooks work
# thus we're making extra sure to delete everything
postcleanup staging:
postcleanup:
stage: postcleanup
environment:
name: staging
......@@ -116,7 +118,12 @@ postcleanup staging:
extends:
.cleanup
.package:
package:
stage: package
environment:
name: staging
only:
- staging
interruptible: true
script:
- helm package chart
......@@ -124,33 +131,13 @@ postcleanup staging:
paths:
- /builds/maps/shibboleth-sp-helm-chart/*.tgz
package staging:
stage: package
environment:
name: staging
only:
- staging
extends:
- .package
package production:
stage: package
environment:
name: production
only:
- production
extends:
- .package
# TODO: only run this in production
# TODO: add tag to branch?
# if the version in Chart.yaml was increased, let's save and push a new version - otherwise, fail
upload staging:
upload:
stage: upload
environment:
name: staging
name: production
only:
- staging
- production
interruptible: true
script:
- grep "^version:" chart/Chart.yaml | sed "s/^.*:\W*\([0-9\.]*\)$/CHART_VERSION=\"\1\"/" > ".variables.env"
......@@ -165,19 +152,17 @@ upload staging:
reports:
dotenv: .variables.env
release staging:
# create a tag on the branch (and, as a side effect, create release tarballs/archives)
release:
stage: release
environment:
name: staging
name: production
only:
- staging
needs:
- job: upload staging
artifacts: true
- production
image: registry.gitlab.com/gitlab-org/release-cli:latest
script:
- echo "Creating release ${CHART_VERSION}"
release:
name: "Release ${CHART_VERSION}"
description: "Created by the pipeline"
description: "Automatically created by the pipeline"
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.3
version: 0.2.4
# 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