You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by sj...@apache.org on 2023/09/25 21:03:05 UTC

[maven] branch jenkins-its-branch-2 updated: CHANGE_BRANCH can be null

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

sjaranowski pushed a commit to branch jenkins-its-branch-2
in repository https://gitbox.apache.org/repos/asf/maven.git


The following commit(s) were added to refs/heads/jenkins-its-branch-2 by this push:
     new 0dfa069a9f CHANGE_BRANCH can be null
0dfa069a9f is described below

commit 0dfa069a9f73446a2c30a40ea529b961f6c06454
Author: Slawomir Jaranowski <s....@gmail.com>
AuthorDate: Mon Sep 25 23:02:52 2023 +0200

    CHANGE_BRANCH can be null
---
 Jenkinsfile | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/Jenkinsfile b/Jenkinsfile
index 357f022c23..33fc905c32 100644
--- a/Jenkinsfile
+++ b/Jenkinsfile
@@ -84,14 +84,15 @@ for (String os in runITsOses) {
                     // will not trample each other plus workaround for JENKINS-52657
                     dir(isUnix() ? 'test' : "c:\\mvn-it-${EXECUTOR_NUMBER}.tmp") {
                         def WORK_DIR=pwd()
+                        def ITS_BRANCH = env.CHANGE_BRANCH != null ? env.CHANGE_BRANCH :  env.BRANCH_NAME;
                         try {
-                          echo "Checkout ITs from branch: ${env.CHANGE_BRANCH}"
+                          echo "Checkout ITs from branch: ${ITS_BRANCH}"
                           checkout([$class: 'GitSCM',
-                                  branches: [[name: env.CHANGE_BRANCH]],
+                                  branches: [[name: ITS_BRANCH]],
                                   extensions: [[$class: 'CloneOption', depth: 1, noTags: true, shallow: true]],
                                   userRemoteConfigs: [[url: 'https://github.com/apache/maven-integration-testing.git']]])
                         } catch (Throwable e) {
-                          echo "Failure checkout ITs branch: ${env.CHANGE_BRANCH} - fallback master branch"
+                          echo "Failure checkout ITs branch: ${ITS_BRANCH} - fallback master branch"
                           checkout([$class: 'GitSCM',
                                   branches: [[name: "*/master"]],
                                   extensions: [[$class: 'CloneOption', depth: 1, noTags: true, shallow: true]],