mirror of
https://github.com/apache/maven.git
synced 2025-02-07 18:49:20 +00:00
Use the same branch name for ITs on Jenkins (#1263)
* Use the same branch name for ITs on Jenkins * Try CHANGE_BRANCH env on PR * CHANGE_BRANCH can be null
This commit is contained in:
parent
14d16064f6
commit
882c8dd974
19
Jenkinsfile
vendored
19
Jenkinsfile
vendored
@ -84,10 +84,21 @@ for (String os in runITsOses) {
|
|||||||
// will not trample each other plus workaround for JENKINS-52657
|
// will not trample each other plus workaround for JENKINS-52657
|
||||||
dir(isUnix() ? 'test' : "c:\\mvn-it-${EXECUTOR_NUMBER}.tmp") {
|
dir(isUnix() ? 'test' : "c:\\mvn-it-${EXECUTOR_NUMBER}.tmp") {
|
||||||
def WORK_DIR=pwd()
|
def WORK_DIR=pwd()
|
||||||
checkout([$class: 'GitSCM',
|
def ITS_BRANCH = env.CHANGE_BRANCH != null ? env.CHANGE_BRANCH : env.BRANCH_NAME;
|
||||||
branches: [[name: "*/master"]],
|
try {
|
||||||
extensions: [[$class: 'CloneOption', depth: 1, noTags: true, shallow: true]],
|
echo "Checkout ITs from branch: ${ITS_BRANCH}"
|
||||||
userRemoteConfigs: [[url: 'https://github.com/apache/maven-integration-testing.git']]])
|
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 master branch"
|
||||||
|
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']]])
|
||||||
|
}
|
||||||
|
|
||||||
if (isUnix()) {
|
if (isUnix()) {
|
||||||
sh "rm -rvf $WORK_DIR/dists $WORK_DIR/it-local-repo"
|
sh "rm -rvf $WORK_DIR/dists $WORK_DIR/it-local-repo"
|
||||||
} else {
|
} else {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user