Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into feature/JENKINS-48711
- Loading branch information
Showing
4 changed files
with
118 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
/* Only keep the 10 most recent builds. */ | ||
properties([[$class: 'BuildDiscarderProperty', | ||
strategy: [$class: 'LogRotator', numToKeepStr: '10']]]) | ||
|
||
// TODO: Move it to Jenkins Pipeline Library | ||
|
||
/* These platforms correspond to labels in ci.jenkins.io, see: | ||
* https://github.com/jenkins-infra/documentation/blob/master/ci.adoc | ||
*/ | ||
List platforms = ['linux', 'windows'] | ||
Map branches = [:] | ||
|
||
for (int i = 0; i < platforms.size(); ++i) { | ||
String label = platforms[i] | ||
branches[label] = { | ||
node(label) { | ||
timestamps { | ||
stage('Checkout') { | ||
checkout scm | ||
} | ||
|
||
stage('Build') { | ||
withEnv([ | ||
"JAVA_HOME=${tool 'jdk8'}", | ||
"PATH+MVN=${tool 'mvn'}/bin", | ||
'PATH+JDK=$JAVA_HOME/bin', | ||
]) { | ||
timeout(30) { | ||
String command = 'mvn --batch-mode clean install -Dmaven.test.failure.ignore=true' | ||
if (isUnix()) { | ||
sh command | ||
} | ||
else { | ||
bat command | ||
} | ||
} | ||
} | ||
} | ||
|
||
stage('Archive') { | ||
/* Archive the test results */ | ||
junit '**/target/surefire-reports/TEST-*.xml' | ||
|
||
if (label == 'linux') { | ||
archiveArtifacts artifacts: 'target/**/*.jar' | ||
// FindBugs is not enabled for this repo so far | ||
// findbugs pattern: '**/target/findbugsXml.xml' | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
|
||
/* Execute our platforms in parallel */ | ||
parallel(branches) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters