Skip to content

Commit

Permalink
Merge branch 'master' into Jenkins-ClassFilter-Whitelisted
Browse files Browse the repository at this point in the history
  • Loading branch information
jglick committed Jan 5, 2018
2 parents a4393d5 + a08d8e1 commit 83804e3
Showing 1 changed file with 56 additions and 1 deletion.
57 changes: 56 additions & 1 deletion Jenkinsfile
@@ -1 +1,56 @@
buildPlugin(platforms: ['linux'], jdkVersions: [7, 8])
/* 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 pattern: '**/target/findbugsXml.xml'
}
}
}
}
}
}

/* Execute our platforms in parallel */
parallel(branches)

0 comments on commit 83804e3

Please sign in to comment.