From 28d65b0df1fc0de9d5865bcdc7f581030c22aded Mon Sep 17 00:00:00 2001
From: OZGCloud <ozgcloud@mgm-tp.com>
Date: Tue, 21 Dec 2021 13:28:07 +0100
Subject: [PATCH] OZG-1784 fix jenkinsfile

---
 Jenkinsfile | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)

diff --git a/Jenkinsfile b/Jenkinsfile
index abb3d5b78b..684a21dbfa 100644
--- a/Jenkinsfile
+++ b/Jenkinsfile
@@ -158,13 +158,15 @@ pipeline {
                 }
 
                 container("k8s") {
-                    def branchName = env.BRANCH_NAME.replaceAll(/[^a-zA-Z0-9]+/, "").toLowerCase()
-                    def namespace = 'e2e-${branchName}-dev'
+                    script {
+                        def branchName = env.BRANCH_NAME.replaceAll(/[^a-zA-Z0-9]+/, "").toLowerCase()
+                        def namespace = 'e2e-${branchName}-dev'
 
-                    echo ${namespace}
+                        echo ${namespace}
 
-                    withCredentials([usernamePassword(credentialsId: 'jenkins-nexus-login', usernameVariable: 'USER', passwordVariable: 'PASSWORD')]) {
-                        sh 'helm upgrade --install --create-namespace goofy goofy --version 0.3.0-SNAPSHOT -f values.yaml --namespace ${namespace} --repo https://nexus.ozg-sh.de/repository/ozg-base-apps-snapshot --username ${USER} --password ${PASSWORD}'
+                        withCredentials([usernamePassword(credentialsId: 'jenkins-nexus-login', usernameVariable: 'USER', passwordVariable: 'PASSWORD')]) {
+                            sh 'helm upgrade --install --create-namespace goofy goofy --version 0.3.0-SNAPSHOT -f values.yaml --namespace ${namespace} --repo https://nexus.ozg-sh.de/repository/ozg-base-apps-snapshot --username ${USER} --password ${PASSWORD}'
+                        }
                     }
                 }
 
-- 
GitLab