Skip to content
Snippets Groups Projects

Resolve "CI: Check if namespace exists"

Merged Varac requested to merge 1037-ci-check-if-namespace-exists into main
All threads resolved!
+ 11
22
@@ -19,16 +19,12 @@ include:
- values-local.yaml.example
- values.yaml
- Chart.yaml
- .gitlab-ci.yml
.delete_helmrelease:
stage: install-helm-chart
script:
- cd ${CHART_DIR:-"."}
- ./fully-delete-helmrelease.sh "nc$CI_MERGE_REQUEST_IID" "nc$CI_MERGE_REQUEST_IID"
- kubectl delete namespace "nc$CI_MERGE_REQUEST_IID"
extends:
- .use_kubernetes
- .chart_changes_rules
.delete_helmrelease: &delete_helmrelease
- cd ${CHART_DIR:-"."}
- ./fully-delete-helmrelease.sh "nc$CI_MERGE_REQUEST_IID" "nc$CI_MERGE_REQUEST_IID"
- kubectl delete namespace "nc$CI_MERGE_REQUEST_IID"
stages:
- lint-helm-chart
@@ -41,17 +37,13 @@ stages:
variables:
CHART_NAME: nextcloud-onlyoffice
pre-install-delete-helmrelease:
extends:
- .delete_helmrelease
# This job will fail if a helmrelease didn't exist (yet). For example in a
# first pipeline for an MR.
allow_failure: true
# This will clean up helmreleases after MRs have been merged, or after some time
post-install-delete-helmrelease:
stage: install-helm-chart
script:
- *delete_helmrelease
extends:
- .delete_helmrelease
- .use_kubernetes
- .chart_changes_rules
# Gets triggered by on_stop of install-helmrelease, or manually
when: manual
environment:
@@ -63,11 +55,8 @@ install-helmrelease:
needs:
# This job contains the `helm dep` artifacts
- job: lint-helm
# We can't install if there's still an installation from a previous run
# present.
- job: pre-install-delete-helmrelease
script:
- cd ${CHART_DIR:-"."}
- *delete_helmrelease
- cp values-local.yaml.example values-ci.yaml
# This sets the domains to files-MR_ID.gitlab.stackspin.net and
# office-MR_ID.gitlab.stackspin.net
Loading