From 9dda351ed4f884a74d6c776acf4fa1d3d2cca048 Mon Sep 17 00:00:00 2001
From: OZGCloud <ozgcloud@mgm-tp.com>
Date: Fri, 10 Mar 2023 09:41:28 +0100
Subject: [PATCH] OZG-3420 increase rollout timeout

---
 goofy-client/apps/goofy-e2e/Jenkinsfile | 45 ++++++++++++++++++++++++-
 1 file changed, 44 insertions(+), 1 deletion(-)

diff --git a/goofy-client/apps/goofy-e2e/Jenkinsfile b/goofy-client/apps/goofy-e2e/Jenkinsfile
index 685b7d3807..e682e2941e 100644
--- a/goofy-client/apps/goofy-e2e/Jenkinsfile
+++ b/goofy-client/apps/goofy-e2e/Jenkinsfile
@@ -31,6 +31,12 @@ pipeline {
 
     stages {
         stage("Clone Gitops Repo") {
+            when {
+                anyOf {
+                    triggeredBy 'BuildUpstreamCause'
+                    triggeredBy cause: "UserIdCause"
+                }
+            }
             steps {
                 script {
                     FAILED_STAGE = env.STAGE_NAME
@@ -41,6 +47,12 @@ pipeline {
         }
 
         stage("Init Default Versions") {
+            when {
+                anyOf {
+                    triggeredBy 'BuildUpstreamCause'
+                    triggeredBy cause: "UserIdCause"
+                }
+            }
             steps {
                 script {
                     FAILED_STAGE = env.STAGE_NAME
@@ -77,6 +89,12 @@ pipeline {
         }
 
         stage("Install Cypress") {
+            when {
+                anyOf {
+                    triggeredBy 'BuildUpstreamCause'
+                    triggeredBy cause: "UserIdCause"
+                }
+            }
             steps {
                 script {
                     FAILED_STAGE = env.STAGE_NAME
@@ -95,6 +113,12 @@ pipeline {
         }
 
         stage('Init k8s') {
+            when {
+                anyOf {
+                    triggeredBy 'BuildUpstreamCause'
+                    triggeredBy cause: "UserIdCause"
+                }
+            }
             steps {
                 script {
                     FAILED_STAGE = env.STAGE_NAME
@@ -110,6 +134,12 @@ pipeline {
         }
 
         stage('Rollout E2E Namespaces') {
+            when {
+                anyOf {
+                    triggeredBy 'BuildUpstreamCause'
+                    triggeredBy cause: "UserIdCause"
+                }
+            }
             steps {
                 script {
                     FAILED_STAGE = env.STAGE_NAME
@@ -136,6 +166,12 @@ pipeline {
         }
 
         stage('Run E2E-Tests') {
+            when {
+                anyOf {
+                    triggeredBy 'BuildUpstreamCause'
+                    triggeredBy cause: "UserIdCause"
+                }
+            }
             failFast false
 
             parallel {
@@ -196,6 +232,12 @@ pipeline {
         }
 
         stage('Delete E2E Namespaces') {
+            when {
+                anyOf {
+                    triggeredBy 'BuildUpstreamCause'
+                    triggeredBy cause: "UserIdCause"
+                }
+            }
             steps {
                 script {
                     FAILED_STAGE = env.STAGE_NAME
@@ -496,6 +538,7 @@ Void waitForHealthyApplication(String bezeichner, String application) {
             waitForHealthyStatus(bezeichner, application)
         }
     } catch (Exception e) {
+        echo "waitForHealthyApplication Exception: ${e}"
         error("Application ${application} unhealthy")
     }
 }
@@ -509,7 +552,7 @@ Boolean isApplicationHealthy(String bezeichner, String application) {
 }
 
 Void waitForHealthyStatus(String bezeichner, String application) {
-    sh "kubectl wait --for=jsonpath='{.status.health.status}'=Healthy applications/by-${bezeichner}-dev-${application} -n argocd --timeout=300s"
+    sh "kubectl wait --for=jsonpath='{.status.health.status}'=Healthy applications/by-${bezeichner}-dev-${application} -n argocd --timeout=360s"
 }
 
 Void publishE2ETestResult(String reportFolder, String reportName) {
-- 
GitLab