2018-02-28 22:22:07 +00:00
|
|
|
final String gitRepoUrl = 'git@github.com:kemitix/mon.git'
|
|
|
|
final String mvn = "mvn --batch-mode --update-snapshots"
|
|
|
|
|
2018-02-22 22:31:45 +00:00
|
|
|
pipeline {
|
|
|
|
agent any
|
|
|
|
stages {
|
2018-02-28 22:22:07 +00:00
|
|
|
stage('Prepare') {
|
|
|
|
steps {
|
|
|
|
git url: gitRepoUrl, branch: '**', credentialsId: 'github-kemitix'
|
|
|
|
}
|
|
|
|
}
|
2018-02-22 22:31:45 +00:00
|
|
|
stage('Build') {
|
2018-02-28 22:29:15 +00:00
|
|
|
parallel {
|
|
|
|
stage('Java 8') {
|
2018-02-28 22:31:37 +00:00
|
|
|
steps {
|
|
|
|
withMaven(maven: 'maven 3.5.2', jdk: 'JDK 1.8') {
|
|
|
|
sh 'mvn clean install'
|
|
|
|
}
|
2018-02-28 22:22:07 +00:00
|
|
|
}
|
2018-02-28 22:29:15 +00:00
|
|
|
}
|
|
|
|
stage('Java 9') {
|
2018-02-28 22:31:37 +00:00
|
|
|
steps {
|
|
|
|
withMaven(maven: 'maven 3.5.2', jdk: 'JDK 9') {
|
|
|
|
sh 'mvn clean install'
|
|
|
|
}
|
2018-02-28 22:22:07 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
stage('Reporting') {
|
|
|
|
steps {
|
2018-02-22 22:31:45 +00:00
|
|
|
junit '**/target/surefire-reports/*.xml'
|
|
|
|
archiveArtifacts '**/target/*.jar'
|
|
|
|
}
|
|
|
|
}
|
2018-02-28 22:22:07 +00:00
|
|
|
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"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2018-02-22 22:31:45 +00:00
|
|
|
}
|
|
|
|
}
|