-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathJenkinsfile
165 lines (165 loc) · 5.06 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
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
/***
* Jenkinsfile for pipeline build of all messagevortex paths
***/
pipeline {
agent any
options {
buildDiscarder(logRotator(numToKeepStr:'20'))
disableConcurrentBuilds()
}
stages {
stage ('Initialize') {
steps {
//git credentialsId: 'github_readonly', url: 'ssh://git@github.com/mgwerder/messageVortex_internal'
checkout scm
sh 'mvn clean'
}
}
stage ('Build') {
steps {
sh 'mvn -DskipTests -pl application-core-library compile'
}
}
stage ('Test on JDK8') {
options {
timeout(time: 120, unit: 'MINUTES')
}
steps{
sh "mvn -pl application-core-library jacoco:prepare-agent test jacoco:report site"
}
post {
success {
junit 'application-core-library/target/surefire-reports/TEST-*.xml'
jacoco changeBuildStatus: true, classPattern: 'application-core-library/target/classes', execPattern: 'application-core-library/target/**.exec', inclusionPattern: '**/*.class', minimumBranchCoverage: '50', minimumClassCoverage: '50', minimumComplexityCoverage: '50', minimumLineCoverage: '70', minimumMethodCoverage: '50', sourcePattern: 'application-core-library/src/main/java,application-core-library/src/test/java'
publishHTML([allowMissing: false, alwaysLinkToLastBuild: false, keepAll: false, reportDir: 'application-core-library/target/site', reportFiles: 'index.html', reportName: 'MessageVortex Report', reportTitles: 'MessageVortex'])
}
}
}
stage ('Package Java') {
steps {
sh 'mkdir /var/www/messagevortex/devel/repo || /bin/true'
sh 'mvn -DskipTests -pl application-core-library package'
}
}
stage('SonarQube analysis') {
steps {
withSonarQubeEnv('SonarQube') {
sh "mvn sonar:sonar"
}
}
}
stage('Publish artifacts') {
steps {
sh 'mvn -pl application-core-library -DskipTests git-commit-id:revision@get-the-git-infos resources:copy-resources@publish-artifacts'
}
}
stage ('Site build') {
steps {
sh 'mvn -pl application-core-library -DskipTests site'
}
}
/*stage ('Test other JDKs') {
parallel {
stage ('Test on JDK10') {
agent {
docker {
image 'maven:3-jdk-10-slim'
args '--mount type=bind,source="$HOME/.m2",target="/root/.m2"'
}
}
options {
timeout(time: 180, unit: 'MINUTES')
}
steps{
catchError(buildResult: 'SUCCESS', stageResult: 'FAILURE') {
sh 'mvn -pl application-core-library test'
}
}
}
stage ('Test on JDK11') {
agent {
docker {
image 'maven:3-jdk-11-slim'
args '--mount type=bind,source="$HOME/.m2",target="/root/.m2"'
}
}
options {
timeout(time: 180, unit: 'MINUTES')
}
steps{
script {
catchError(buildResult: 'SUCCESS', stageResult: 'FAILURE') {
sh 'mvn -pl application-core-library test'
}
}
}
}
stage ('Test on OPENJDK17') {
agent {
docker {
image 'maven:3-openjdk-17-slim'
args '--mount type=bind,source="$HOME/.m2",target="/root/.m2"'
}
}
options {
timeout(time: 180, unit: 'MINUTES')
}
steps {
script {
catchError(buildResult: 'SUCCESS', stageResult: 'FAILURE') {
sh 'mvn -pl application-core-library test'
}
}
}
}
stage ('Test on Amazon Correto 16') {
agent {
docker {
image 'maven:3-amazoncorretto-16'
args '--mount type=bind,source="$HOME/.m2",target="/root/.m2"'
}
}
options {
timeout(time: 180, unit: 'MINUTES')
}
steps {
script {
catchError(buildResult: 'SUCCESS', stageResult: 'FAILURE') {
sh 'mvn -pl application-core-library test'
}
}
}
}
stage ('Test on (latest)') {
agent {
docker {
image 'maven:latest'
args '--mount type=bind,source="$HOME/.m2",target="/root/.m2"'
}
}
options {
timeout(time: 180, unit: 'MINUTES')
}
steps {
script {
catchError(buildResult: 'SUCCESS', stageResult: 'FAILURE') {
sh 'mvn -pl application-core-library test'
}
}
}
}
}
}*/
stage ('Package all') {
steps {
sh 'mkdir /var/www/messagevortex/devel/repo || /bin/true'
sh 'mvn -DskipTests package'
}
}
}
post {
success {
archiveArtifacts artifacts: 'application-core-library/target/*.jar,application-core-library/target/*.exe,application-core-library/target/*.dmg,thesis/target/main/latex/**/*.pdf*,application-core-library/target/lib-runtimes/*.jar', fingerprint: true
}
}
}