-
Notifications
You must be signed in to change notification settings - Fork 4
/
Jenkinsfile
84 lines (83 loc) · 2.98 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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
pipeline {
agent any
stages {
stage('Build') {
steps {
sh 'mvn install -B -P build'
archiveArtifacts(onlyIfSuccessful: true, artifacts: '**/target/*.jar')
}
}
stage('Run Unit Tests') {
parallel {
stage('Server') {
steps {
sh 'mvn test -B -pl server || exit 0'
sh 'mvn jacoco:report -pl server'
}
post {
always {
sh '[ -d server/target/site ] && cd server/target/site && zip -r coverage-server.zip jacoco && cd -; exit 0'
}
}
}
stage('Retrofit Wrapper') {
steps {
sh 'mvn test -B -pl retrofit-wrapper || exit 0'
sh 'mvn jacoco:report -pl retrofit-wrapper'
}
post {
always {
sh '[ -d retrofit-wrapper/target/site ] && cd retrofit-wrapper/target/site && zip -r coverage-wrapper.zip jacoco && cd -; exit 0'
}
}
}
stage('CLI') {
steps {
sh 'mvn test -B -pl cli || exit 0'
sh 'mvn jacoco:report -pl cli'
}
post {
always {
sh '[ -d cli/target/site ] && cd cli/target/site && zip -r coverage-cli.zip jacoco && cd -; exit 0'
}
}
}
}
post {
always {
junit(testResults: '**/target/surefire-reports/*.xml', allowEmptyResults: true)
archiveArtifacts allowEmptyArchive: true, artifacts: '**/target/site/*.zip'
}
}
}
stage('Integration Test (Server)') {
steps {
sh 'mvn integration-test -P integration-test -pl server || exit 0'
sh 'mvn jacoco:report -pl server'
}
post {
always {
sh '[ -d server/target/site ] && cd server/target/site && zip -r coverage-server-integration.zip jacoco-it && cd -; exit 0'
junit(testResults: '**/target/surefire-reports/*.xml', allowEmptyResults: true)
archiveArtifacts allowEmptyArchive: true, artifacts: '**/target/site/*.zip'
}
}
}
stage('Deploy') {
when {
allOf {
branch 'master'
environment name: 'TOSCANA_DEPLOY_ON_BUILD', value: 'true'
}
}
steps {
sh 'chmod +x utils/jenkins/deploy-to-local-docker.sh && utils/jenkins/deploy-to-local-docker.sh'
}
}
}
post {
always {
sh 'mvn clean'
}
}
}