Skip to content

Commit

Permalink
Use the same branch name for ITs on Jenkins (#1263)
Browse files Browse the repository at this point in the history
(cherry picked from commit 882c8dd)
  • Loading branch information
slawekjaranowski committed Oct 17, 2023
1 parent 2bc4449 commit 53edd71
Showing 1 changed file with 15 additions and 4 deletions.
19 changes: 15 additions & 4 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -84,10 +84,21 @@ 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()
checkout([$class: 'GitSCM',
branches: [[name: "*/master"]],
extensions: [[$class: 'CloneOption', depth: 1, noTags: true, shallow: true]],
userRemoteConfigs: [[url: 'https://github.com/apache/maven-integration-testing.git']]])
def ITS_BRANCH = env.CHANGE_BRANCH != null ? env.CHANGE_BRANCH : env.BRANCH_NAME;
try {
echo "Checkout ITs from branch: ${ITS_BRANCH}"
checkout([$class: 'GitSCM',
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: ${ITS_BRANCH} - fallback maven-3.9.x branch"
checkout([$class: 'GitSCM',
branches: [[name: "maven-3.9.x"]],
extensions: [[$class: 'CloneOption', depth: 1, noTags: true, shallow: true]],
userRemoteConfigs: [[url: 'https://github.com/apache/maven-integration-testing.git']]])
}

if (isUnix()) {
sh "rm -rvf $WORK_DIR/apache-maven-dist.zip $WORK_DIR/it-local-repo"
} else {
Expand Down

0 comments on commit 53edd71

Please sign in to comment.