forked from payara/Payara
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Jenkinsfile-Nightly
351 lines (344 loc) · 17.5 KB
/
Jenkinsfile-Nightly
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
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
#!groovy
def pom
java.lang.String DOMAIN_NAME='test-domain'
def payaraBuildNumber
pipeline {
agent any
options {
disableConcurrentBuilds()
}
environment {
MP_METRICS_TAGS='tier=integration'
Dibbles = "\${Dabbles}"
Bibbly = "Bibbles"
}
tools {
jdk "zulu-8"
}
stages {
stage('Report') {
steps {
script{
pom = readMavenPom file: 'pom.xml'
payaraBuildNumber = "${currentBuild.number}"
echo "Payara pom version is ${pom.version}"
echo "Build number is ${payaraBuildNumber}"
echo "Domain name is ${DOMAIN_NAME}"
}
}
}
stage('Clean') {
steps {
echo '*#*#*#*#*#*#*#*#*#*#*#*# Wiping Maven Repo *#*#*#*#*#*#*#*#*#*#*#*#*#*#*#'
sh "rm -rf ~/.m2/repository/*"
echo '*#*#*#*#*#*#*#*#*#*#*#*# Cleaning /tmp *#*#*#*#*#*#*#*#*#*#*#*#*#*#*#'
//noinspection SpellCheckingInspection
sh "rm -rf /tmp/arquillian*; rm -rf /tmp/javaee*; rm -rf /tmp/fileinstall*; rm -rf /tmp/surefire*; rm -rf /tmp/payara*; rm -rf /tmp/cargo*"
}
}
stage('Build') {
steps {
echo '*#*#*#*#*#*#*#*#*#*#*#*# Building SRC *#*#*#*#*#*#*#*#*#*#*#*#*#*#*#'
withCredentials([usernameColonPassword(credentialsId: 'JenkinsNexusUser', variable: 'NEXUS_USER')]) {
sh """mvn -B -V -ff -e clean install --strict-checksums \
-Djavax.net.ssl.trustStore=${env.JAVA_HOME}/jre/lib/security/cacerts \
-Djavax.xml.accessExternalSchema=all -Dbuild.number=${payaraBuildNumber}\
-Dsurefire.rerunFailingTestsCount=2 -PBuildExtras"""
}
echo '*#*#*#*#*#*#*#*#*#*#*#*# Built SRC *#*#*#*#*#*#*#*#*#*#*#*#*#*#*#'
}
}
stage('Setup for Quicklook Tests') {
steps {
setupDomain()
}
}
stage('Run Quicklook Tests') {
steps {
echo '*#*#*#*#*#*#*#*#*#*#*#*# Running test *#*#*#*#*#*#*#*#*#*#*#*#*#*#*#'
sh """mvn -B -V -ff -e clean test -Pall --strict-checksums \
-Dglassfish.home=\"${pwd()}/appserver/distributions/payara/target/stage/payara5/glassfish\" \
-Djavax.net.ssl.trustStore=${env.JAVA_HOME}/jre/lib/security/cacerts \
-Djavax.xml.accessExternalSchema=all -Dsurefire.rerunFailingTestsCount=2 \
-f appserver/tests/quicklook/pom.xml"""
echo '*#*#*#*#*#*#*#*#*#*#*#*# Ran test *#*#*#*#*#*#*#*#*#*#*#*#*#*#*#'
}
post {
always {
teardownDomain()
junit '**/target/surefire-reports/*.xml'
}
}
}
stage('Upload Releases') {
steps {
echo '*#*#*#*#*#*#*#*#*#*#*#*# Renaming Distributions *#*#*#*#*#*#*#*#*#*#*#*#*#*#*#'
sh "cp ./appserver/distributions/payara/target/payara.zip ./payara-prerelease.zip"
sh "cp ./appserver/distributions/payara-ml/target/payara-ml.zip ./payara-ml-prerelease.zip"
sh "cp ./appserver/distributions/payara-web/target/payara-web.zip ./payara-web-prerelease.zip"
sh "cp ./appserver/distributions/payara-web-ml/target/payara-web-ml.zip ./payara-web-ml-prerelease.zip"
sh "cp ./appserver/extras/payara-micro/payara-micro-distribution/target/payara-micro.jar ./payara-micro-prerelease.jar"
sh "cp ./appserver/extras/embedded/all/target/payara-embedded-all.jar ./payara-embedded-all-prerelease.jar"
sh "cp ./appserver/extras/embedded/web/target/payara-embedded-web.jar ./payara-embedded-web-prerelease.jar"
echo '*#*#*#*#*#*#*#*#*#*#*#*# Uploading Distributions *#*#*#*#*#*#*#*#*#*#*#*#*#*#*#'
withAWS(region:'eu-west-1', credentials: 'awsPayara') {
s3Upload bucket: 'payara.fish', file: 'payara-prerelease.zip'
s3Upload bucket: 'payara.fish', file: 'payara-ml-prerelease.zip'
s3Upload bucket: 'payara.fish', file: 'payara-web-prerelease.zip'
s3Upload bucket: 'payara.fish', file: 'payara-web-ml-prerelease.zip'
s3Upload bucket: 'payara.fish', file: 'payara-micro-prerelease.jar'
s3Upload bucket: 'payara.fish', file: 'payara-embedded-all-prerelease.jar'
s3Upload bucket: 'payara.fish', file: 'payara-embedded-web-prerelease.jar'
}
}
}
stage('Checkout EE8 Tests') {
steps{
echo '*#*#*#*#*#*#*#*#*#*#*#*# Checking out EE8 tests *#*#*#*#*#*#*#*#*#*#*#*#*#*#*#'
checkout changelog: false, poll: false, scm: [$class: 'GitSCM',
branches: [[name: "*/master"]],
userRemoteConfigs: [[url: "https://github.com/payara/patched-src-javaee8-samples.git"]]]
echo '*#*#*#*#*#*#*#*#*#*#*#*# Checked out EE8 tests *#*#*#*#*#*#*#*#*#*#*#*#*#*#*#'
}
}
stage('Setup for EE8 Tests') {
steps {
setupDomain()
}
}
stage('Run EE8 Tests') {
steps {
echo '*#*#*#*#*#*#*#*#*#*#*#*# Running test *#*#*#*#*#*#*#*#*#*#*#*#*#*#*#'
catchError(buildResult: 'SUCCESS', stageResult: 'FAILURE') {
sh "mvn -B -V -ff -e clean install --strict-checksums \
-Dsurefire.useFile=false -Djavax.net.ssl.trustStore=${env.JAVA_HOME}/jre/lib/security/cacerts \
-Djavax.xml.accessExternalSchema=all -Dpayara.version=${pom.version} \
-Dsurefire.rerunFailingTestsCount=2 -Ppayara-server-remote"
}
echo '*#*#*#*#*#*#*#*#*#*#*#*# Ran test *#*#*#*#*#*#*#*#*#*#*#*#*#*#*#'
}
post {
always {
teardownDomain()
junit '**/target/surefire-reports/*.xml'
}
}
}
stage('Checkout CargoTracker Tests') {
steps{
echo '*#*#*#*#*#*#*#*#*#*#*#*# Checking out CargoTracker tests *#*#*#*#*#*#*#*#*#*#*#*#*#*#*#'
checkout changelog: false, poll: false, scm: [$class: 'GitSCM',
branches: [[name: "*/master"]],
userRemoteConfigs: [[url: "https://github.com/payara/cargotracker.git"]]]
echo '*#*#*#*#*#*#*#*#*#*#*#*# Checked out CargoTracker tests *#*#*#*#*#*#*#*#*#*#*#*#*#*#*#'
}
}
stage('Run CargoTracker Tests Embedded') {
steps {
echo '*#*#*#*#*#*#*#*#*#*#*#*# Running test *#*#*#*#*#*#*#*#*#*#*#*#*#*#*#'
catchError(buildResult: 'SUCCESS', stageResult: 'FAILURE') {
sh """mvn -B -V -ff -e clean install --strict-checksums -Dsurefire.useFile=false \
-Djavax.net.ssl.trustStore=${env.JAVA_HOME}/jre/lib/security/cacerts \
-Djavax.xml.accessExternalSchema=all -Dpayara.version=${pom.version} \
-Dsurefire.rerunFailingTestsCount=2 -Ppayara-server-embedded,payara5"""
}
echo '*#*#*#*#*#*#*#*#*#*#*#*# Ran test *#*#*#*#*#*#*#*#*#*#*#*#*#*#*#'
}
post {
always {
junit '**/target/surefire-reports/*.xml'
}
}
}
stage('Checkout EE7 Tests') {
steps{
echo '*#*#*#*#*#*#*#*#*#*#*#*# Checking out EE7 tests *#*#*#*#*#*#*#*#*#*#*#*#*#*#*#'
checkout changelog: false, poll: false, scm: [$class: 'GitSCM',
branches: [[name: "*/master"]],
userRemoteConfigs: [[url: "https://github.com/payara/patched-src-javaee7-samples.git"]]]
echo '*#*#*#*#*#*#*#*#*#*#*#*# Checked out EE7 tests *#*#*#*#*#*#*#*#*#*#*#*#*#*#*#'
}
}
stage('Setup for EE7 Tests') {
steps {
setupDomain()
}
}
stage('Run EE7 Tests') {
steps {
echo '*#*#*#*#*#*#*#*#*#*#*#*# Running test *#*#*#*#*#*#*#*#*#*#*#*#*#*#*#'
catchError(buildResult: 'SUCCESS', stageResult: 'FAILURE') {
sh """mvn -B -V -ff -e clean install --strict-checksums -Dsurefire.useFile=false \
-Djavax.net.ssl.trustStore=${env.JAVA_HOME}/jre/lib/security/cacerts \
-Djavax.xml.accessExternalSchema=all -Dpayara.version=${pom.version} \
-Dpayara_domain=${DOMAIN_NAME} \
-Dsurefire.rerunFailingTestsCount=2 -Ppayara-server-remote,stable,payara5"""
}
echo '*#*#*#*#*#*#*#*#*#*#*#*# Ran test *#*#*#*#*#*#*#*#*#*#*#*#*#*#*#'
}
post {
always {
teardownDomain()
junit '**/target/surefire-reports/*.xml'
}
}
}
stage('Checkout MicroProfile TCK Runners') {
steps{
echo '*#*#*#*#*#*#*#*#*#*#*#*# Checking out MicroProfile TCKs *#*#*#*#*#*#*#*#*#*#*#*#*#*#*#'
checkout changelog: false, poll: false, scm: [$class: 'GitSCM',
branches: [[name: "*/master"]],
userRemoteConfigs: [[url: "https://github.com/payara/MicroProfile-TCK-Runners.git"]]]
echo '*#*#*#*#*#*#*#*#*#*#*#*# Checked out MicroProfile TCKs *#*#*#*#*#*#*#*#*#*#*#*#*#*#*#'
}
}
stage('Run MicroProfile Config TCK') {
steps {
echo '*#*#*#*#*#*#*#*#*#*#*#*# Running Config TCK *#*#*#*#*#*#*#*#*#*#*#*#*#*#*#'
catchError(buildResult: 'SUCCESS', stageResult: 'FAILURE') {
sh "mvn -B -V -ff -e clean verify --strict-checksums -f MicroProfile-Config/tck-runner/pom.xml -Ppayara-micro-managed \
-Dsurefire.rerunFailingTestsCount=2 -Dpayara.version=${pom.version}"
}
echo '*#*#*#*#*#*#*#*#*#*#*#*# Ran Config TCK *#*#*#*#*#*#*#*#*#*#*#*#*#*#*#'
}
post {
always {
junit '**/target/surefire-reports/*.xml'
}
}
}
stage('Run MicroProfile Fault Tolerance TCK') {
steps {
echo '*#*#*#*#*#*#*#*#*#*#*#*# Running Fault Tolerance TCK *#*#*#*#*#*#*#*#*#*#*#*#*#*#*#'
catchError(buildResult: 'SUCCESS', stageResult: 'FAILURE') {
sh "mvn -B -V -ff -e clean verify --strict-checksums -f MicroProfile-Fault-Tolerance/tck-runner/pom.xml \
-Dsurefire.rerunFailingTestsCount=2 -Ppayara-micro-managed -Dpayara.version=${pom.version}"
}
echo '*#*#*#*#*#*#*#*#*#*#*#*# Ran Fault Tolerance TCK *#*#*#*#*#*#*#*#*#*#*#*#*#*#*#'
}
post {
always {
junit '**/target/surefire-reports/*.xml'
}
}
}
stage('Run MicroProfile Health TCK') {
steps {
echo '*#*#*#*#*#*#*#*#*#*#*#*# Installing MP Health TCK Arquillian Extension *#*#*#*#*#*#*#*#*#*#*#*#*#*#*#'
catchError(buildResult: 'SUCCESS', stageResult: 'FAILURE') {
sh "mvn -B -V -ff -e clean install --strict-checksums -f pom.xml -Dpayara.version=${pom.version} -N"
sh "mvn -B -V -ff -e clean install --strict-checksums -f MicroProfile-Health/pom.xml -Dpayara.version=${pom.version} -N"
sh "mvn -B -V -ff -e clean install --strict-checksums -f MicroProfile-Health/tck-arquillian-extension/pom.xml \
-Dpayara.version=${pom.version} -N"
echo '*#*#*#*#*#*#*#*#*#*#*#*# Installed MP Health TCK Arquillian Extension *#*#*#*#*#*#*#*#*#*#*#*#*#*#*#'
echo '*#*#*#*#*#*#*#*#*#*#*#*# Running Health TCK *#*#*#*#*#*#*#*#*#*#*#*#*#*#*#'
sh "mvn -B -V -ff -e clean verify -f MicroProfile-Health/tck-runner/pom.xml -Ppayara-micro-managed \
-Dsurefire.rerunFailingTestsCount=2 -Dpayara.version=${pom.version}"
}
echo '*#*#*#*#*#*#*#*#*#*#*#*# Ran Health TCK *#*#*#*#*#*#*#*#*#*#*#*#*#*#*#'
}
post {
always {
junit '**/target/surefire-reports/*.xml'
}
}
}
stage('Run MicroProfile JWT-Auth TCK') {
steps {
echo '*#*#*#*#*#*#*#*#*#*#*#*# Installing MP JWT-Auth TCK Arquillian Extension *#*#*#*#*#*#*#*#*#*#*#*#*#*#*#'
catchError(buildResult: 'SUCCESS', stageResult: 'FAILURE') {
sh "mvn -B -V -ff -e clean install -f pom.xml -Dpayara.version=${pom.version} -N"
sh "mvn -B -V -ff -e clean install --strict-checksums -f MicroProfile-JWT-Auth/pom.xml -Dpayara.version=${pom.version} -N"
sh "mvn -B -V -ff -e clean install --strict-checksums -f MicroProfile-JWT-Auth/tck-arquillian-extension/pom.xml \
-Dpayara.version=${pom.version}"
echo '*#*#*#*#*#*#*#*#*#*#*#*# Installed MP JWT-Auth TCK Arquillian Extension *#*#*#*#*#*#*#*#*#*#*#*#*#*#*#'
echo '*#*#*#*#*#*#*#*#*#*#*#*# Running JWT-Auth TCK *#*#*#*#*#*#*#*#*#*#*#*#*#*#*#'
sh "mvn -B -V -ff -e clean verify -f MicroProfile-JWT-Auth/tck-runner/pom.xml \
-Ppayara-micro-managed,full -Dsurefire.rerunFailingTestsCount=2 -Dpayara.version=${pom.version}"
}
echo '*#*#*#*#*#*#*#*#*#*#*#*# Ran JWT-Auth TCK *#*#*#*#*#*#*#*#*#*#*#*#*#*#*#'
}
post {
always {
junit '**/target/surefire-reports/*.xml'
}
}
}
stage('Run MicroProfile Metrics TCK') {
steps {
echo '*#*#*#*#*#*#*#*#*#*#*#*# Running Metrics TCK *#*#*#*#*#*#*#*#*#*#*#*#*#*#*#'
catchError(buildResult: 'SUCCESS', stageResult: 'FAILURE') {
sh "mvn -B -V -ff -e clean verify --strict-checksums -f MicroProfile-Metrics/tck-runner/pom.xml -Ppayara-micro-managed \
-Dsurefire.rerunFailingTestsCount=2 -Dpayara.version=${pom.version}"
}
echo '*#*#*#*#*#*#*#*#*#*#*#*# Ran Metrics TCK *#*#*#*#*#*#*#*#*#*#*#*#*#*#*#'
}
post {
always {
junit '**/target/surefire-reports/*.xml'
}
}
}
stage('Run MicroProfile OpenAPI TCK') {
steps {
echo '*#*#*#*#*#*#*#*#*#*#*#*# Running OpenAPI TCK *#*#*#*#*#*#*#*#*#*#*#*#*#*#*#'
catchError(buildResult: 'SUCCESS', stageResult: 'FAILURE') {
sh "mvn -B -V -ff -e clean verify --strict-checksums -f MicroProfile-OpenAPI/tck-runner/pom.xml -Ppayara-micro-managed \
-Dsurefire.rerunFailingTestsCount=2 -Dpayara.version=${pom.version}"
}
echo '*#*#*#*#*#*#*#*#*#*#*#*# Ran OpenAPI TCK *#*#*#*#*#*#*#*#*#*#*#*#*#*#*#'
}
post {
always {
junit '**/target/surefire-reports/*.xml'
}
}
}
stage('Run MicroProfile OpenTracing TCK') {
steps {
echo '*#*#*#*#*#*#*#*#*#*#*#*# Running OpenTracing TCK *#*#*#*#*#*#*#*#*#*#*#*#*#*#*#'
catchError(buildResult: 'SUCCESS', stageResult: 'FAILURE') {
sh "mvn -B -V -ff -e clean verify --strict-checksums -f MicroProfile-OpenTracing/tck-runner/pom.xml -Ppayara-micro-managed \
-Dsurefire.rerunFailingTestsCount=2 -Dpayara.version=${pom.version}"
}
echo '*#*#*#*#*#*#*#*#*#*#*#*# Ran OpenTracing TCK *#*#*#*#*#*#*#*#*#*#*#*#*#*#*#'
}
post {
always {
junit '**/target/surefire-reports/*.xml'
}
}
}
stage('Run MicroProfile Rest Client TCK') {
steps {
echo '*#*#*#*#*#*#*#*#*#*#*#*# Running Rest Client TCK *#*#*#*#*#*#*#*#*#*#*#*#*#*#*#'
catchError(buildResult: 'SUCCESS', stageResult: 'FAILURE') {
sh "mvn -B -V -ff -e clean verify --strict-checksums -f MicroProfile-Rest-Client/tck-runner/pom.xml -Ppayara-micro-managed \
-Dsurefire.rerunFailingTestsCount=2 -Dpayara.version=${pom.version}"
}
echo '*#*#*#*#*#*#*#*#*#*#*#*# Ran Rest Client TCK *#*#*#*#*#*#*#*#*#*#*#*#*#*#*#'
}
post {
always {
junit '**/target/surefire-reports/*.xml'
}
}
}
}
}
void setupDomain() {
echo '*#*#*#*#*#*#*#*#*#*#*#*# Setting up tests *#*#*#*#*#*#*#*#*#*#*#*#*#*#*#'
script{
ASADMIN = "./appserver/distributions/payara/target/stage/payara5/bin/asadmin"
DOMAIN_NAME = "test-domain"
}
sh "${ASADMIN} create-domain --nopassword ${DOMAIN_NAME}"
sh "${ASADMIN} start-domain ${DOMAIN_NAME}"
sh "${ASADMIN} start-database || true"
}
def teardownDomain() {
echo 'tidying up after tests:'
sh "${ASADMIN} stop-domain ${DOMAIN_NAME}"
sh "${ASADMIN} stop-database || true"
sh "${ASADMIN} delete-domain ${DOMAIN_NAME}"
}