This is an automated email from the ASF dual-hosted git repository.
rombert pushed a commit to branch feature/SLING-7245
in repository https://gitbox.apache.org/repos/asf/sling-tooling-jenkins.git
The following commit(s) were added to refs/heads/feature/SLING-7245 by this
push:
new 9142112 SLING-7245 - Validate pull requests using Jenkins
9142112 is described below
commit 9142112028cca22a8d2dbb6c7cabb60dea6b1db2
Author: Robert Munteanu <[email protected]>
AuthorDate: Tue Dec 18 00:06:06 2018 +0100
SLING-7245 - Validate pull requests using Jenkins
Disable all used publishers in case of non-reference builds.
---
vars/slingOsgiBundleBuild.groovy | 17 ++++++++++++-----
1 file changed, 12 insertions(+), 5 deletions(-)
diff --git a/vars/slingOsgiBundleBuild.groovy b/vars/slingOsgiBundleBuild.groovy
index 32acdd8..2c6b1c6 100644
--- a/vars/slingOsgiBundleBuild.groovy
+++ b/vars/slingOsgiBundleBuild.groovy
@@ -39,21 +39,28 @@ def call(Map params = [:]) {
echo "Final job config: ${jobConfig}"
}
- // TODO - configure all published to be enabled only for the first
build
if ( jobConfig.enabled ) {
- deploy = true
+ // the reference build is always the first one, and the only one
to deploy, archive artifacts, etc
+ // usually this is the build done with the oldest JDK version, to
ensure maximum compatibility
+ def reference = true
jobConfig.jdks.each { jdkVersion ->
- def goal = jobConfig.mavenGoal ? jobConfig.mavenGoal : (
deploy ? "deploy" : "verify" )
+ def goal = jobConfig.mavenGoal ? jobConfig.mavenGoal : (
reference ? "deploy" : "verify" )
stage("Build (Java ${jdkVersion}, ${goal})") {
def jenkinsJdkLabel = availableJDKs[jdkVersion]
if ( !jenkinsJdkLabel )
throw new RuntimeException("Unknown JDK version
${jdkVersion}")
- withMaven(maven: mvnVersion, jdk: jenkinsJdkLabel,
options: [artifactsPublisher(disabled: true)] ) {
+ withMaven(maven: mvnVersion, jdk: jenkinsJdkLabel,
+ options: [
+ artifactsPublisher(disabled: true),
+ junitPublisher(disabled: !reference),
+ openTasksPublisher(disabled: !reference),
+ dependenciesFingerprintPublisher(disabled:
!reference)
+ ] ) {
dir(moduleDir) {
sh "mvn clean ${goal}
${jobConfig.additionalMavenParams}"
}
}
- if ( jobConfig.archivePatterns ) {
+ if ( reference && jobConfig.archivePatterns ) {
archiveArtifacts(artifacts:
jobConfig.archivePatterns.join(','), allowEmptyArchive: true)
}
}