-
Notifications
You must be signed in to change notification settings - Fork 1
/
Jenkinsfile
56 lines (56 loc) · 1.6 KB
/
Jenkinsfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
pipeline {
agent {
docker {
image 'maven:3.8-jdk-11'
args '-v /home/jenkins/.m2:/var/maven/.m2 -v /home/jenkins/.gnupg:/.gnupg -e MAVEN_CONFIG=/var/maven/.m2 -e MAVEN_OPTS=-Duser.home=/var/maven'
}
}
environment {
COVERALLS_REPO_TOKEN = credentials('coveralls_repo_token_spring_boot_wiremock')
GPG_SECRET = credentials('gpg_password')
}
stages {
stage ('Test Spring-Boot Compatibility') {
steps {
script {
def versionsAsString = sh(script: 'mvn org.apache.maven.plugins:maven-help-plugin:3.2.0:evaluate -Dexpression=compatible-spring-boot-versions -q -DforceStdout', returnStdout:true).trim()
def versionsArray = versionsAsString.split(',')
versionsArray.each {
stage("Verify against Spring-Boot ${it}") {
sh "mvn -B clean verify -Dversion.spring-boot=${it.trim()}"
}
}
}
}
}
stage('Build Final') {
steps {
sh 'mvn -B clean verify'
}
}
stage('Coverage') {
steps {
sh 'mvn -B jacoco:report jacoco:report-integration coveralls:report -DrepoToken=$COVERALLS_REPO_TOKEN'
}
}
stage('javadoc') {
steps {
sh 'mvn -B javadoc:javadoc'
}
}
stage('Deploy SNAPSHOT') {
when {
branch 'dev'
}
steps {
sh 'mvn -B -Prelease -DskipTests -Dgpg.passphrase=${GPG_SECRET} deploy'
}
}
}
post {
always {
archiveArtifacts(artifacts: '*.md')
junit (testResults: 'target/surefire-reports/*.xml', allowEmptyResults: true)
}
}
}