This is an automated email from the ASF dual-hosted git repository.

yichi pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/beam.git


The following commit(s) were added to refs/heads/master by this push:
     new 472be11  [BEAM-12898] Trying out solution suggestion for JENKINS-66189 
to solve problem that postBuildScript not running
     new 314e260  Merge pull request #15558 from y1chi/beam-12898
472be11 is described below

commit 472be11e38d80f7934f6b9863e36d13869b3692d
Author: Yichi Zhang <zyi...@google.com>
AuthorDate: Wed Sep 22 16:39:15 2021 -0700

    [BEAM-12898] Trying out solution suggestion for JENKINS-66189 to solve 
problem that postBuildScript not running
---
 .test-infra/jenkins/Kubernetes.groovy | 25 ++++++++++++++++++-------
 1 file changed, 18 insertions(+), 7 deletions(-)

diff --git a/.test-infra/jenkins/Kubernetes.groovy 
b/.test-infra/jenkins/Kubernetes.groovy
index cc708a5..b476a21 100644
--- a/.test-infra/jenkins/Kubernetes.groovy
+++ b/.test-infra/jenkins/Kubernetes.groovy
@@ -79,15 +79,26 @@ class Kubernetes {
 
   private static void addCleanupSteps() {
     job.publishers {
-      postBuildScripts {
-        steps {
-          if (!namespace.isEmpty()) {
-            shell("${KUBERNETES_SCRIPT} deleteNamespace ${namespace}")
+      postBuildScript {
+        buildSteps {
+          postBuildStep {
+            stopOnFailure(false)
+            results([
+              'FAILURE',
+              'SUCCESS',
+              'UNSTABLE',
+              'NOT_BUILT',
+              'ABORTED'
+            ])
+            buildSteps {
+              if (!namespace.isEmpty()) {
+                shell("${KUBERNETES_SCRIPT} deleteNamespace ${namespace}")
+              }
+              shell("rm ${kubeconfigLocation}")
+            }
           }
-          shell("rm ${kubeconfigLocation}")
         }
-        onlyIfBuildSucceeds(false)
-        onlyIfBuildFails(false)
+        markBuildUnstable(false)
       }
     }
   }

Reply via email to