Skip to content

Commit 98d407a

Browse files
committed
build on nodes instead of running ITs
1 parent 18e868c commit 98d407a

File tree

1 file changed

+28
-38
lines changed

1 file changed

+28
-38
lines changed

Jenkinsfile

+28-38
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ node(jenkinsEnv.nodeSelection(osNode)) {
6666
}
6767
}
6868

69-
tests = resolveScm source: [$class: 'GitSCMSource', credentialsId: '', id: '_', remote: 'https://gitbox.apache.org/repos/asf/maven-integration-testing.git', traits: [[$class: 'jenkins.plugins.git.traits.BranchDiscoveryTrait'], [$class: 'GitToolSCMSourceTrait', gitTool: 'Default']]], targets: [BRANCH_NAME, 'master']
69+
tests = resolveScm source: [$class: 'GitSCMSource', credentialsId: '', id: '_', remote: 'https://gitbox.apache.org/repos/asf/maven.git', traits: [[$class: 'jenkins.plugins.git.traits.BranchDiscoveryTrait'], [$class: 'GitToolSCMSourceTrait', gitTool: 'Default']]], targets: [BRANCH_NAME, 'master']
7070
}
7171
}
7272

@@ -78,48 +78,38 @@ for (String os in runITsOses) {
7878
String mvnName = jenkinsEnv.mvnFromVersion(os, "${runITsMvn}")
7979
echo "OS: ${os} JDK: ${jdk} => Label: ${osLabel} JDK: ${jdkName}"
8080

81+
def cmd = [
82+
'mvn',
83+
'verify',
84+
'-DskipTests', '-Drat.skip'
85+
]
86+
if (jdk == '7') {
87+
// Java 7u80 has TLS 1.2 disabled by default: need to explicitely enable
88+
cmd += '-Dhttps.protocols=TLSv1.2'
89+
}
90+
8191
String stageId = "${os}-jdk${jdk}"
82-
String stageLabel = "Run ITs ${os.capitalize()} Java ${jdk}"
92+
String stageLabel = "Rebuild ${os.capitalize()} Java ${jdk}"
8393
runITsTasks[stageId] = {
8494
node(jenkinsEnv.nodeSelection(osLabel)) {
95+
def WORK_DIR=pwd()
8596
stage("${stageLabel}") {
8697
echo "NODE_NAME = ${env.NODE_NAME}"
87-
// on Windows, need a short path or we hit 256 character limit for paths
88-
// using EXECUTOR_NUMBER guarantees that concurrent builds on same agent
89-
// will not trample each other plus workaround for JENKINS-52657
90-
dir(isUnix() ? 'test' : "c:\\mvn-it-${EXECUTOR_NUMBER}.tmp") {
91-
def WORK_DIR=pwd()
92-
checkout tests
93-
if (isUnix()) {
94-
sh "rm -rvf $WORK_DIR/apache-maven-dist.zip $WORK_DIR/it-local-repo"
95-
} else {
96-
bat "if exist it-local-repo rmdir /s /q it-local-repo"
97-
bat "if exist apache-maven-dist.zip del /q apache-maven-dist.zip"
98-
}
99-
unstash 'dist'
100-
try {
101-
withMaven(jdk: jdkName, maven: mvnName, mavenLocalRepo:"${WORK_DIR}/it-local-repo", options:[
102-
junitPublisher(ignoreAttachments: false)
103-
]) {
104-
String cmd = "${runITscommand} -DmavenDistro=$WORK_DIR/apache-maven-dist.zip -Dmaven.test.failure.ignore=true"
105-
if (stageId.endsWith('-jdk7')) {
106-
// Java 7u80 has TLS 1.2 disabled by default: need to explicitly enable
107-
cmd = "${cmd} -Dhttps.protocols=TLSv1.2"
108-
}
109-
110-
if (isUnix()) {
111-
sh 'df -hT'
112-
sh "${cmd}"
113-
} else {
114-
bat 'wmic logicaldisk get size,freespace,caption'
115-
bat "${cmd}"
116-
}
117-
}
118-
} finally {
119-
archiveDirs(stageId, ['core-it-suite-logs':'core-it-suite/target/test-classes',
120-
'core-it-suite-reports':'core-it-suite/target/surefire-reports'])
121-
deleteDir() // clean up after ourselves to reduce disk space
122-
}
98+
checkout tests
99+
withMaven(jdk: jdkName, maven: mvnName, mavenLocalRepo:"${WORK_DIR}/.repository", options:[
100+
artifactsPublisher(disabled: false),
101+
junitPublisher(ignoreAttachments: false),
102+
findbugsPublisher(disabled: false),
103+
openTasksPublisher(disabled: false),
104+
dependenciesFingerprintPublisher(),
105+
invokerPublisher(),
106+
pipelineGraphPublisher()
107+
]) {
108+
if (isUnix()) {
109+
sh cmd.join(' ')
110+
} else {
111+
bat cmd.join(' ')
112+
}
123113
}
124114
}
125115
}

0 commit comments

Comments
 (0)