Skip to content
Snippets Groups Projects
Verified Commit e4797050 authored by Maarten de Waard's avatar Maarten de Waard :angel:
Browse files

Install Nextcloud releases in different namespaces in CI

parent aa34ce3d
No related branches found
No related tags found
No related merge requests found
Pipeline #15941 failed with stages
in 41 seconds
......@@ -25,6 +25,7 @@ include:
script:
- cd ${CHART_DIR:-"."}
- ./fully-delete-helmrelease.sh "nc$CI_MERGE_REQUEST_IID"
- kubectl delete namespace "nc$CI_MERGE_REQUEST_IID"
extends:
- .use_kubernetes
- .chart_changes_rules
......@@ -74,7 +75,8 @@ 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
- helm install --wait "nc$CI_MERGE_REQUEST_IID" . -f values-ci.yaml
- 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:
name: helmrelease/nc$CI_MERGE_REQUEST_IID
url: https://files-nc$CI_MERGE_REQUEST_IID.gitlab.stackspin.net
......@@ -88,7 +90,7 @@ test-helm-chart:
stage: test-helm-chart
script:
- cd ${CHART_DIR:-"."}
- helm test --logs "nc$CI_MERGE_REQUEST_IID"
- helm test -n nc$CI_MERGE_REQUEST_IID --logs "nc$CI_MERGE_REQUEST_IID"
extends:
- .use_kubernetes
- .chart_changes_rules
#! /usr/bin/env bash
if [ -z "$1" ]; then
echo "Usage: ./fully-delete-chart RELEASE_NAME"
if [ -z "$2" ]; then
echo "Usage: ./fully-delete-chart NAMESPACE RELEASE_NAME"
exit 1
else
release="$1"
namespace="$1"
release="$2"
fi
kubectl delete pod "$release-onlyoffice-documentserver-taiko-test"
kubectl delete pod -n "$namespace" "$release-onlyoffice-documentserver-taiko-test"
kubectl delete job "$release-setup-apps"
kubectl delete job -n "$namespace" "$release-setup-apps"
# This command can fail, but that is not a problem
kubectl delete pvc \
kubectl delete pvc -n "$namespace" \
"$release-nextcloud-nextcloud" \
"data-$release-rabbitmq-0" \
"redis-data-$release-redis-master-0" \
......@@ -20,13 +21,13 @@ kubectl delete pvc \
"redis-data-$release-redis-slave-1" \
"data-$release-mariadb-0"
helm delete --wait "$release"
helm delete -n "$namespace" --wait "$release"
output=$(kubectl get pod -l "app.kubernetes.io/instance=$release")
output=$(kubectl get pod -n "$namespace" -l "app.kubernetes.io/instance=$release")
until [ "$output" == "" ]
do
echo "waiting for pods to be deleted, pods still running:"
echo "$output"
sleep 5
output=$(kubectl get pod -l "app.kubernetes.io/instance=$release")
output=$(kubectl get pod -n "$namespace" -l "app.kubernetes.io/instance=$release")
done
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