Skip to content
Snippets Groups Projects
Unverified Commit d1678a4b authored by Varac's avatar Varac
Browse files

Merge the pre-install-delete-helmrelease and install-helmrelease jobs

parent 3f616615
No related branches found
No related tags found
1 merge request!189Resolve "CI: Check if namespace exists"
Pipeline #17423 passed with stages
in 40 minutes and 31 seconds
......@@ -21,15 +21,10 @@ include:
- 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
......@@ -42,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:
......@@ -64,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
......@@ -76,7 +64,6 @@ install-helmrelease:
# Make sure TLS certificate secrets for different MRs do not clash
- sed -i "s/files-cert/files-cert-nc$CI_MERGE_REQUEST_IID/" values-ci.yaml
- sed -i "s/office-cert/office-cert-nc$CI_MERGE_REQUEST_IID/" values-ci.yaml
- kubectl get namespace "nc$CI_MERGE_REQUEST_IID" && kubectl delete namespace "nc$CI_MERGE_REQUEST_IID"
- kubectl create namespace "nc$CI_MERGE_REQUEST_IID"
- helm install -n nc$CI_MERGE_REQUEST_IID --wait "nc$CI_MERGE_REQUEST_IID" . -f values-ci.yaml
environment:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment