Jenkins: Simplifies pipeline

This commit is contained in:
Johannes Schnatterer 2018-07-18 17:06:10 +02:00
parent 79b6805639
commit cd65c32c2e

11
Jenkinsfile vendored
View file

@ -9,8 +9,8 @@ properties([
node { node {
cesFqdn = findHostName() String cesFqdn = findHostName()
cesUrl = "https://${cesFqdn}" String cesUrl = "https://${cesFqdn}"
String credentialsId = 'scmCredentials' String credentialsId = 'scmCredentials'
Maven mvn = new MavenWrapper(this) Maven mvn = new MavenWrapper(this)
@ -28,16 +28,15 @@ node {
archiveArtifacts artifacts: '**/target/*.jar', fingerprint: true archiveArtifacts artifacts: '**/target/*.jar', fingerprint: true
} }
String jacoco = "org.jacoco:jacoco-maven-plugin:0.8.1"
parallel( parallel(
test: { test: {
stage('Test') { stage('Test') {
String jacoco = "org.jacoco:jacoco-maven-plugin:0.7.7.201606060606"
mvn "${jacoco}:prepare-agent test ${jacoco}:report" mvn "${jacoco}:prepare-agent test ${jacoco}:report"
} }
}, },
integrationTest: { integrationTest: {
stage('Integration Test') { stage('Integration Test') {
String jacoco = "org.jacoco:jacoco-maven-plugin:0.7.7.201606060606";
mvn "${jacoco}:prepare-agent-integration failsafe:integration-test ${jacoco}:report-integration" mvn "${jacoco}:prepare-agent-integration failsafe:integration-test ${jacoco}:report-integration"
} }
} }
@ -62,7 +61,3 @@ node {
// Archive Unit and integration test results, if any // Archive Unit and integration test results, if any
junit allowEmptyResults: true, testResults: '**/target/failsafe-reports/TEST-*.xml,**/target/surefire-reports/TEST-*.xml' junit allowEmptyResults: true, testResults: '**/target/failsafe-reports/TEST-*.xml,**/target/surefire-reports/TEST-*.xml'
} }
// Init global vars in order to avoid NPE
String cesFqdn = ''
String cesUrl = ''