Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master' into JENKINS-38690
Browse files Browse the repository at this point in the history
  • Loading branch information
jtnord committed Oct 6, 2016
2 parents 751cb2e + b513112 commit 48104c7
Showing 1 changed file with 54 additions and 0 deletions.
54 changes: 54 additions & 0 deletions Jenkinsfile
@@ -0,0 +1,54 @@
#!/usr/bin/env groovy

/* Only keep the 10 most recent builds. */
properties([[$class: 'BuildDiscarderProperty',
strategy: [$class: 'LogRotator', numToKeepStr: '10']]])


/* 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 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'

/* Archive the build artifacts */
archiveArtifacts artifacts: 'target/**/*.jar'
}
}
}
}
}

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

0 comments on commit 48104c7

Please sign in to comment.