Skip to content

Commit 53edd71

Browse files
Use the same branch name for ITs on Jenkins (#1263)
(cherry picked from commit 882c8dd)
1 parent 2bc4449 commit 53edd71

File tree

1 file changed

+15
-4
lines changed

1 file changed

+15
-4
lines changed

Jenkinsfile

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -84,10 +84,21 @@ for (String os in runITsOses) {
8484
// will not trample each other plus workaround for JENKINS-52657
8585
dir(isUnix() ? 'test' : "c:\\mvn-it-${EXECUTOR_NUMBER}.tmp") {
8686
def WORK_DIR=pwd()
87-
checkout([$class: 'GitSCM',
88-
branches: [[name: "*/master"]],
89-
extensions: [[$class: 'CloneOption', depth: 1, noTags: true, shallow: true]],
90-
userRemoteConfigs: [[url: 'https://github.com/apache/maven-integration-testing.git']]])
87+
def ITS_BRANCH = env.CHANGE_BRANCH != null ? env.CHANGE_BRANCH : env.BRANCH_NAME;
88+
try {
89+
echo "Checkout ITs from branch: ${ITS_BRANCH}"
90+
checkout([$class: 'GitSCM',
91+
branches: [[name: ITS_BRANCH]],
92+
extensions: [[$class: 'CloneOption', depth: 1, noTags: true, shallow: true]],
93+
userRemoteConfigs: [[url: 'https://github.com/apache/maven-integration-testing.git']]])
94+
} catch (Throwable e) {
95+
echo "Failure checkout ITs branch: ${ITS_BRANCH} - fallback maven-3.9.x branch"
96+
checkout([$class: 'GitSCM',
97+
branches: [[name: "maven-3.9.x"]],
98+
extensions: [[$class: 'CloneOption', depth: 1, noTags: true, shallow: true]],
99+
userRemoteConfigs: [[url: 'https://github.com/apache/maven-integration-testing.git']]])
100+
}
101+
91102
if (isUnix()) {
92103
sh "rm -rvf $WORK_DIR/apache-maven-dist.zip $WORK_DIR/it-local-repo"
93104
} else {

0 commit comments

Comments
 (0)