diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 78ce9bb954be1fdcd80fbc6dceb62eff194640f5..2431be21bd3476bfd56df0f41db04d80db2eec99 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -60,11 +60,7 @@ create geotiff storage:
   extends: .helm_based_job
   stage: create storage
   script:
-    - if [ -n "$CI_COMMIT_TAG" ]; then
-      ns="geosphere";
-      else
-      ns="geosphere-test";
-      fi
+    - ns=$(./helpers/get_namespace.sh)
     # copy secret kubeconfig to the mounted (pwd) directory
     - cp $kubekorner_k3s_config .
     - kubeconfig=$(basename $kubekorner_k3s_config)
@@ -131,11 +127,7 @@ deploy_prod_rabbit:
   extends: .helm_based_job
   stage: deploy rabbit
   script:
-    - if [ -n "$CI_COMMIT_TAG" ]; then
-        ns="geosphere";
-      else
-        ns="geosphere-test";
-      fi
+    - ns=$(./helpers/get_namespace.sh)
     # copy secret kubeconfig to the mounted (pwd) directory
     - cp $kubekorner_k3s_config .
     - kubeconfig=$(basename $kubekorner_k3s_config)
@@ -175,11 +167,7 @@ deploy_g16_grb:
   extends: .helm_based_job
   stage: deploy GRB
   script:
-    - if [ -n "$CI_COMMIT_TAG" ]; then
-        ns="geosphere";
-      else
-        ns="geosphere-test";
-      fi
+    - ns=$(./helpers/get_namespace.sh)
     - cd geosphere-grb/chart
     - source cspp-geo-grb/cibuild.env
     # copy secret kubeconfig to the mounted (pwd) directory
@@ -189,7 +177,7 @@ deploy_g16_grb:
     # copy extra values files to the local directory (where helm has access via docker mount)
     - cp ../../production/values-grb-g16.yaml .
     # namespace names are the same as domain names
-    - helm upgrade -v 2 --install --kubeconfig $kubeconfig --namespace $ns --set persistence.enabled --set persistence.storageClass=longhorn -f values-grb-g16.yaml cspp-geo-grb cspp-geo-grb/
+    - helm upgrade -v 2 --install --kubeconfig $kubeconfig --namespace $ns --set persistence.enabled=true --set persistence.storageClass=longhorn -f values-grb-g16.yaml cspp-geo-grb cspp-geo-grb/
   dependencies:
     - get_chart_grb
   rules:
@@ -204,11 +192,7 @@ deploy_geo2grid_g16_radf:
   extends: .helm_based_job
   stage: deploy G2G
   script:
-    - if [ -n "$CI_COMMIT_TAG" ]; then
-      ns="geosphere";
-      else
-      ns="geosphere-test";
-      fi
+    - ns=$(./helpers/get_namespace.sh)
     - cd geosphere-geo2grid/chart
     - source cspp-geo-geo2grid/cibuild.env
     # copy secret kubeconfig to the mounted (pwd) directory
diff --git a/helpers/get_namespace.sh b/helpers/get_namespace.sh
new file mode 100755
index 0000000000000000000000000000000000000000..450c2a8f04fce83e6fb9b30c4acbe4a25ac51c79
--- /dev/null
+++ b/helpers/get_namespace.sh
@@ -0,0 +1,9 @@
+#!/usr/bin/env bash
+
+if [[ -n "$CI_COMMIT_TAG" ]]; then
+    ns="geosphere";
+else
+    ns="geosphere-test";
+fi
+
+echo $ns