kske
09d251a02a
All checks were successful
zdm/event-bus/pipeline/head This commit looks good
The Jenkinsfile performs packaging and testing on the project. When on the develop branch, a SonarQube analysis is conducted.
42 lines
647 B
Groovy
42 lines
647 B
Groovy
pipeline {
|
|
agent any
|
|
|
|
options {
|
|
ansiColor('xterm')
|
|
}
|
|
|
|
stages {
|
|
stage('Build') {
|
|
steps {
|
|
sh 'mvn -DskipTests clean package'
|
|
}
|
|
}
|
|
stage('Test') {
|
|
steps {
|
|
sh 'mvn test'
|
|
}
|
|
post {
|
|
always {
|
|
junit '*/target/surefire-reports/*.xml'
|
|
publishCoverage adapters: [jacocoAdapter(mergeToOneReport: true, path: '*/target/site/jacoco/jacoco.xml')]
|
|
}
|
|
}
|
|
}
|
|
stage('SonarQube Analysis') {
|
|
when {
|
|
branch 'develop'
|
|
}
|
|
steps {
|
|
withSonarQubeEnv('KSKE SonarQube') {
|
|
sh "$SONAR_MAVEN_GOAL"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
post {
|
|
success {
|
|
archiveArtifacts artifacts: '*/target/event-bus-*.jar'
|
|
}
|
|
}
|
|
}
|