jenkins: test on both java 8 and 9

This commit is contained in:
Paul Campbell 2018-02-28 22:22:07 +00:00
parent e41555e9f3
commit 773a428c20

41
Jenkinsfile vendored
View file

@ -1,20 +1,43 @@
final String gitRepoUrl = 'git@github.com:kemitix/mon.git'
final String mvn = "mvn --batch-mode --update-snapshots"
pipeline { pipeline {
agent any agent any
stages { stages {
stage('Prepare') {
steps {
git url: gitRepoUrl, branch: '**', credentialsId: 'github-kemitix'
}
}
stage('Build') { stage('Build') {
steps { steps {
checkout([ parallel {
$class: 'GitSCM', stage('Java 8') {
branches: [[name: '**']], withMaven(maven: 'maven 3.5.2', jdk: 'JDK 1.8') {
doGenerateSubmoduleConfigurations: false, sh 'mvn clean install'
extensions: [[$class: 'CleanBeforeCheckout']], }
submoduleCfg: [], }
userRemoteConfigs: [[credentialsId: 'github-kemitix', url: 'git@github.com:kemitix/mon.git']] stage('Java 9') {
]) withMaven(maven: 'maven 3.5.2', jdk: 'JDK 9') {
sh './mvnw clean install' sh 'mvn clean install'
}
}
}
}
}
stage('Reporting') {
steps {
junit '**/target/surefire-reports/*.xml' junit '**/target/surefire-reports/*.xml'
archiveArtifacts '**/target/*.jar' archiveArtifacts '**/target/*.jar'
} }
} }
stage('Deploy') {
when { expression { (env.GIT_BRANCH == 'master') } }
steps {
withMaven(maven: 'maven 3.5.2', jdk: 'JDK 1.8') {
sh "${mvn} deploy --activate-profiles release"
}
}
}
} }
} }