-
Notifications
You must be signed in to change notification settings - Fork 75
/
Y_build.groovy
460 lines (451 loc) · 21.7 KB
/
Y_build.groovy
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
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
def config = new groovy.json.JsonSlurper().parseText(readFileFromWorkspace('JenkinsJobs/JobDSL.json'))
def STREAMS = config.Streams
for (STREAM in STREAMS){
def BRANCH = config.Branches[STREAM]
def MAJOR = STREAM.split('\\.')[0]
def MINOR = STREAM.split('\\.')[1]
pipelineJob('YPBuilds/Y-build-' + STREAM){
description('Daily Maintenance Builds.')
properties {
pipelineTriggers {
triggers {
cron {
spec("""TZ=America/Toronto
# format: Minute Hour Day Month Day of the week (0-7)
#Daily Y-build
0 10 * * *
#milestone week
#0 6 * * 2
#0 6 * * 4
#
#0 2 21 7 4
""")
}
}
}
}
logRotator {
numToKeep(25)
}
definition {
cpsScm {
lightweight(true)
scm {
github('https://github.com/eclipse-platform/eclipse.platform.releng.aggregator/', 'master')
}
}
cps {
sandbox()
script('''
pipeline {
options {
timeout(time: 360, unit: 'MINUTES')
timestamps()
buildDiscarder(logRotator(numToKeepStr:'25'))
}
agent {
kubernetes {
inheritFrom 'centos-8'
yaml """
apiVersion: v1
kind: Pod
spec:
containers:
- name: "jnlp"
resources:
limits:
memory: "8192Mi"
cpu: "4000m"
requests:
memory: "6144Mi"
cpu: "2000m"
"""
}
}
tools {
jdk 'openjdk-jdk17-latest'
}
environment {
MAVEN_OPTS = "-Xmx6G"
CJE_ROOT = "${WORKSPACE}/eclipse.platform.releng.aggregator/eclipse.platform.releng.aggregator/cje-production"
PATH = "$PATH:/opt/tools/apache-maven/latest/bin"
logDir = "$CJE_ROOT/buildlogs"
}
stages {
stage('Clean Workspace'){
steps {
container('jnlp') {
cleanWs()
}
}
}
stage('Setup intial configuration'){
steps {
container('jnlp') {
sshagent(['github-bot-ssh']) {
dir ('eclipse.platform.releng.aggregator') {
sh \'\'\'
git clone -b master [email protected]:eclipse-platform/eclipse.platform.releng.aggregator.git
\'\'\'
}
}
sh \'\'\'
cd ${WORKSPACE}/eclipse.platform.releng.aggregator/eclipse.platform.releng.aggregator/cje-production
chmod +x mbscripts/*
mkdir -p $logDir
\'\'\'
}
}
}
stage('Generate environment variables'){
steps {
container('jnlp') {
sh \'\'\'
cd ${WORKSPACE}/eclipse.platform.releng.aggregator/eclipse.platform.releng.aggregator/cje-production/mbscripts
cp ../Y-build/buildproperties.txt ../buildproperties.txt
./mb010_createEnvfiles.sh $CJE_ROOT/buildproperties.shsource 2>&1 | tee $logDir/mb010_createEnvfiles.sh.log
if [[ ${PIPESTATUS[0]} -ne 0 ]]
then
echo "Failed in Generate environment variables stage"
exit 1
fi
\'\'\'
}
}
}
stage('Load PGP keys'){
environment {
KEYRING = credentials('secret-subkeys-releng.asc')
KEYRING_PASSPHRASE = credentials('secret-subkeys-releng.acs-passphrase')
}
steps {
container('jnlp') {
sh \'\'\'
cd ${WORKSPACE}/eclipse.platform.releng.aggregator/eclipse.platform.releng.aggregator/cje-production/mbscripts
./mb011_loadPGPKeys.sh 2>&1 | tee $logDir/mb011_loadPGPKeys.sh.log
if [[ ${PIPESTATUS[0]} -ne 0 ]]
then
echo "Failed in Load PGP keys"
exit 1
fi
\'\'\'
}
}
}
stage('Export environment variables stage 1'){
steps {
container('jnlp') {
script {
env.BUILD_IID = sh(script:'echo $(source $CJE_ROOT/buildproperties.shsource;echo $BUILD_TYPE$TIMESTAMP)', returnStdout: true)
env.BUILD_VERSION = sh(script:'echo $(source $CJE_ROOT/buildproperties.shsource;echo $RELEASE_VER)', returnStdout: true)
env.STREAM = sh(script:'echo $(source $CJE_ROOT/buildproperties.shsource;echo $STREAM)', returnStdout: true)
env.EBUILDER_HASH = sh(script:'echo $(source $CJE_ROOT/buildproperties.shsource;echo $EBUILDER_HASH)', returnStdout: true)
env.RELEASE_VER = sh(script:'echo $(source $CJE_ROOT/buildproperties.shsource;echo $RELEASE_VER)', returnStdout: true)
}
}
}
}
stage('Create Base builder'){
steps {
container('jnlp') {
sshagent(['projects-storage.eclipse.org-bot-ssh']) {
withAnt(installation: 'apache-ant-latest') {
sh \'\'\'
cd ${WORKSPACE}/eclipse.platform.releng.aggregator/eclipse.platform.releng.aggregator/cje-production/mbscripts
./mb020_createBaseBuilder.sh $CJE_ROOT/buildproperties.shsource 2>&1 | tee $logDir/mb020_createBaseBuilder.sh.log
if [[ ${PIPESTATUS[0]} -ne 0 ]]
then
echo "Failed in Create Base builder stage"
exit 1
fi
\'\'\'
}
}
}
}
}
stage('Download reference repo for repo reports'){
steps {
container('jnlp') {
sshagent(['projects-storage.eclipse.org-bot-ssh']) {
sh \'\'\'
cd ${WORKSPACE}/eclipse.platform.releng.aggregator/eclipse.platform.releng.aggregator/cje-production/mbscripts
./mb030_downloadBuildToCompare.sh $CJE_ROOT/buildproperties.shsource 2>&1 | tee $logDir/mb030_downloadBuildToCompare.sh.log
if [[ ${PIPESTATUS[0]} -ne 0 ]]
then
echo "Failed in Download reference repo for repo reports stage"
exit 1
fi
\'\'\'
}
}
}
}
stage('Clone Repositories'){
steps {
container('jnlp') {
sshagent(['git.eclipse.org-bot-ssh', 'github-bot-ssh']) {
sh \'\'\'
git config --global user.email "[email protected]"
git config --global user.name "Eclipse Releng Bot"
cd ${WORKSPACE}/eclipse.platform.releng.aggregator/eclipse.platform.releng.aggregator/cje-production/mbscripts
./mb100_cloneRepos.sh $CJE_ROOT/buildproperties.shsource 2>&1 | tee $logDir/mb100_cloneRepos.sh.log
if [[ ${PIPESTATUS[0]} -ne 0 ]]
then
echo "Failed in Clone Repositories stage"
exit 1
fi
\'\'\'
}
}
}
}
stage('Tag Build Inputs'){
steps {
container('jnlp') {
sshagent (['git.eclipse.org-bot-ssh', 'github-bot-ssh', 'projects-storage.eclipse.org-bot-ssh']) {
sh \'\'\'
cd ${WORKSPACE}/eclipse.platform.releng.aggregator/eclipse.platform.releng.aggregator/cje-production/mbscripts
bash -x ./mb110_tagBuildInputs.sh $CJE_ROOT/buildproperties.shsource 2>&1 | tee $logDir/mb110_tagBuildInputs.sh.log
if [[ ${PIPESTATUS[0]} -ne 0 ]]
then
echo "Failed in Tag Build Inputs stage"
exit 1
fi
\'\'\'
}
}
}
}
stage('Copy test configs for Y-build'){
steps {
container('jnlp') {
sh \'\'\'
cd ${WORKSPACE}/eclipse.platform.releng.aggregator/eclipse.platform.releng.aggregator/cje-production/Y-build
cp testConfigs.php ${WORKSPACE}/eclipse.platform.releng.aggregator/eclipse.platform.releng.aggregator/cje-production/gitCache/eclipse.platform.releng.aggregator/eclipse.platform.releng.tychoeclipsebuilder/eclipse/publishingFiles/staticDropFiles/.
cp testConfigs.php ${WORKSPACE}/eclipse.platform.releng.aggregator/eclipse.platform.releng.aggregator/eclipse.platform.releng.tychoeclipsebuilder/eclipse/publishingFiles/staticDropFiles/.
cp publish.xml ${WORKSPACE}/eclipse.platform.releng.aggregator/eclipse.platform.releng.aggregator/cje-production/gitCache/eclipse.platform.releng.aggregator/eclipse.platform.releng.tychoeclipsebuilder/eclipse/buildScripts/.
cp publish.xml ${WORKSPACE}/eclipse.platform.releng.aggregator/eclipse.platform.releng.aggregator/eclipse.platform.releng.tychoeclipsebuilder/eclipse/buildScripts/.
\'\'\'
}
}
}
stage('Create Source Bundles'){
steps {
container('jnlp') {
sh \'\'\'
cd ${WORKSPACE}/eclipse.platform.releng.aggregator/eclipse.platform.releng.aggregator/cje-production/mbscripts
unset JAVA_TOOL_OPTIONS
unset _JAVA_OPTIONS
./mb200_createSourceBundles.sh $CJE_ROOT/buildproperties.shsource 2>&1 | tee $logDir/mb200_createSourceBundles.sh.log
if [[ ${PIPESTATUS[0]} -ne 0 ]]
then
echo "Failed in Create Source Bundles stage"
exit 1
fi
\'\'\'
}
}
}
stage('Aggregator maven build'){
environment {
KEYRING_PASSPHRASE = credentials('secret-subkeys-releng.acs-passphrase')
}
steps {
container('jnlp') {
sh \'\'\'
cd ${WORKSPACE}/eclipse.platform.releng.aggregator/eclipse.platform.releng.aggregator/cje-production/mbscripts
unset JAVA_TOOL_OPTIONS
unset _JAVA_OPTIONS
./mb220_buildSdkPatch.sh $CJE_ROOT/buildproperties.shsource 2>&1 | tee $logDir/mb220_buildSdkPatch.sh.log
if [[ ${PIPESTATUS[0]} -ne 0 ]]
then
echo "Failed in Aggregator maven build stage"
exit 1
fi
\'\'\'
}
}
}
stage('Gather Eclipse Parts'){
environment {
KEYRING = credentials('secret-subkeys-releng.asc')
KEYRING_PASSPHRASE = credentials('secret-subkeys-releng.acs-passphrase')
}
steps {
container('jnlp') {
withAnt(installation: 'apache-ant-latest') {
sh \'\'\'
cd ${WORKSPACE}/eclipse.platform.releng.aggregator/eclipse.platform.releng.aggregator/cje-production/mbscripts
bash -x ./mb300_gatherEclipseParts.sh $CJE_ROOT/buildproperties.shsource 2>&1 | tee $logDir/mb300_gatherEclipseParts.sh.log
if [[ ${PIPESTATUS[0]} -ne 0 ]]
then
echo "Failed in Gather Eclipse Parts stage"
exit 1
fi
\'\'\'
}
}
}
}
stage('Gather Equinox Parts'){
environment {
KEYRING = credentials('secret-subkeys-releng.asc')
KEYRING_PASSPHRASE = credentials('secret-subkeys-releng.acs-passphrase')
}
steps {
container('jnlp') {
withAnt(installation: 'apache-ant-latest') {
sh \'\'\'
cd ${WORKSPACE}/eclipse.platform.releng.aggregator/eclipse.platform.releng.aggregator/cje-production/mbscripts
./mb310_gatherEquinoxParts.sh $CJE_ROOT/buildproperties.shsource 2>&1 | tee $logDir/mb310_gatherEquinoxParts.sh.log
if [[ ${PIPESTATUS[0]} -ne 0 ]]
then
echo "Failed in Gather Equinox Parts stage"
exit 1
fi
\'\'\'
}
}
}
}
stage('Generate Repo reports'){
steps {
container('jnlp') {
sh \'\'\'
cd ${WORKSPACE}/eclipse.platform.releng.aggregator/eclipse.platform.releng.aggregator/cje-production/mbscripts
unset JAVA_TOOL_OPTIONS
unset _JAVA_OPTIONS
./mb500_createRepoReports.sh $CJE_ROOT/buildproperties.shsource 2>&1 | tee $logDir/mb500_createRepoReports.sh.log
if [[ ${PIPESTATUS[0]} -ne 0 ]]
then
echo "Failed in Generate Repo reports stage"
exit 1
fi
\'\'\'
}
}
}
stage('Generate API tools reports'){
steps {
container('jnlp') {
sh \'\'\'
cd ${WORKSPACE}/eclipse.platform.releng.aggregator/eclipse.platform.releng.aggregator/cje-production/mbscripts
unset JAVA_TOOL_OPTIONS
unset _JAVA_OPTIONS
./mb510_createApiToolsReports.sh $CJE_ROOT/buildproperties.shsource 2>&1 | tee $logDir/mb510_createApiToolsReports.sh.log
if [[ ${PIPESTATUS[0]} -ne 0 ]]
then
echo "Failed in Generate API tools reports stage"
exit 1
fi
\'\'\'
}
}
}
stage('Export environment variables stage 2'){
steps {
container('jnlp') {
script {
env.BUILD_IID = sh(script:'echo $(source $CJE_ROOT/buildproperties.shsource;echo $BUILD_TYPE$TIMESTAMP)', returnStdout: true)
env.BUILD_VERSION = sh(script:'echo $(source $CJE_ROOT/buildproperties.shsource;echo $RELEASE_VER)', returnStdout: true)
env.STREAM = sh(script:'echo $(source $CJE_ROOT/buildproperties.shsource;echo $STREAM)', returnStdout: true)
env.COMPARATOR_ERRORS_SUBJECT = sh(script:'echo $(source $CJE_ROOT/buildproperties.shsource;echo $COMPARATOR_ERRORS_SUBJECT)', returnStdout: true)
env.COMPARATOR_ERRORS_BODY = sh(script:'echo $(source $CJE_ROOT/buildproperties.shsource;echo $COMPARATOR_ERRORS_BODY)', returnStdout: true)
env.POM_UPDATES_SUBJECT = sh(script:'echo $(source $CJE_ROOT/buildproperties.shsource;echo $POM_UPDATES_SUBJECT)', returnStdout: true)
env.POM_UPDATES_BODY = sh(script:'echo $(source $CJE_ROOT/buildproperties.shsource;echo $POM_UPDATES_BODY)', returnStdout: true)
env.EBUILDER_HASH = sh(script:'echo $(source $CJE_ROOT/buildproperties.shsource;echo $EBUILDER_HASH)', returnStdout: true)
env.RELEASE_VER = sh(script:'echo $(source $CJE_ROOT/buildproperties.shsource;echo $RELEASE_VER)', returnStdout: true)
}
}
}
}
stage('Archive artifacts'){
steps {
container('jnlp') {
sh \'\'\'
cd ${WORKSPACE}/eclipse.platform.releng.aggregator/eclipse.platform.releng.aggregator/cje-production
source $CJE_ROOT/buildproperties.shsource
cp -r $logDir/* $CJE_ROOT/$DROP_DIR/$BUILD_ID/buildlogs
rm -rf $logDir
rm -rf $CJE_ROOT/$DROP_DIR/$BUILD_ID/apitoolingreference
cp $CJE_ROOT/buildproperties.txt $CJE_ROOT/$DROP_DIR/$BUILD_ID
cp $CJE_ROOT/buildproperties.php $CJE_ROOT/$DROP_DIR/$BUILD_ID
cp $CJE_ROOT/buildproperties.properties $CJE_ROOT/$DROP_DIR/$BUILD_ID
cp $CJE_ROOT/buildproperties.shsource $CJE_ROOT/$DROP_DIR/$BUILD_ID
cp $CJE_ROOT/$DROP_DIR/$BUILD_ID/buildproperties.* $CJE_ROOT/$EQUINOX_DROP_DIR/$BUILD_ID
\'\'\'
}
archiveArtifacts '**/siteDir/**'
}
}
stage('Promote Eclipse platform'){
steps {
container('jnlp') {
sshagent(['projects-storage.eclipse.org-bot-ssh']) {
sh \'\'\'
cd ${WORKSPACE}/eclipse.platform.releng.aggregator/eclipse.platform.releng.aggregator/cje-production/mbscripts
./mb600_promoteEclipse.sh $CJE_ROOT/buildproperties.shsource
\'\'\'
}
}
build job: 'eclipse.releng.updateIndex', wait: false
}
}
stage('Promote Equinox'){
steps {
container('jnlp') {
sshagent(['projects-storage.eclipse.org-bot-ssh']) {
sh \'\'\'
cd ${WORKSPACE}/eclipse.platform.releng.aggregator/eclipse.platform.releng.aggregator/cje-production/mbscripts
./mb610_promoteEquinox.sh $CJE_ROOT/buildproperties.shsource
\'\'\'
}
}
}
}
stage('Promote Update Site'){
steps {
container('jnlp') {
sshagent(['projects-storage.eclipse.org-bot-ssh']) {
sh \'\'\'
cd ${WORKSPACE}/eclipse.platform.releng.aggregator/eclipse.platform.releng.aggregator/cje-production/mbscripts
./mb620_promoteUpdateSite.sh $CJE_ROOT/buildproperties.shsource
\'\'\'
}
}
}
}
stage('Trigger tests'){
steps {
container('jnlp') {
build job: 'YPBuilds/ep''' + MAJOR + MINOR + '''Y-unit-cen64-gtk3-java17', parameters: [string(name: 'buildId', value: "${env.BUILD_IID.trim()}")], wait: false
build job: 'YPBuilds/ep''' + MAJOR + MINOR + '''Y-unit-cen64-gtk3-java21', parameters: [string(name: 'buildId', value: "${env.BUILD_IID.trim()}")], wait: false
build job: 'YPBuilds/ep''' + MAJOR + MINOR + '''Y-unit-cen64-gtk3-java24', parameters: [string(name: 'buildId', value: "${env.BUILD_IID.trim()}")], wait: false
build job: 'YPBuilds/ep''' + MAJOR + MINOR + '''Y-unit-macM1-java17', parameters: [string(name: 'buildId', value: "${env.BUILD_IID.trim()}")], wait: false
build job: 'YPBuilds/ep''' + MAJOR + MINOR + '''Y-unit-mac64-java17', parameters: [string(name: 'buildId', value: "${env.BUILD_IID.trim()}")], wait: false
build job: 'Start-smoke-tests', parameters: [string(name: 'buildId', value: "${env.BUILD_IID.trim()}")], wait: false
}
}
}
}
post {
failure {
emailext body: "Please go to <a href='${BUILD_URL}console'>${BUILD_URL}console</a> and check the build failure.<br><br>",
subject: "${env.BUILD_VERSION} Y-Build: ${env.BUILD_IID.trim()} - BUILD FAILED",
from:"[email protected]"
}
success {
emailext body: "Eclipse downloads:<br> <a href='https://download.eclipse.org/eclipse/downloads/drops4/${env.BUILD_IID.trim()}'>https://download.eclipse.org/eclipse/downloads/drops4/${env.BUILD_IID.trim()}</a><br><br> Build logs and/or test results (eventually):<br> <a href='https://download.eclipse.org/eclipse/downloads/drops4/${env.BUILD_IID.trim()}/testResults.php'>https://download.eclipse.org/eclipse/downloads/drops4/${env.BUILD_IID.trim()}/testResults.php</a><br><br>${env.POM_UPDATES_BODY.trim()}${env.COMPARATOR_ERRORS_BODY.trim()}Software site repository:<br> <a href='https://download.eclipse.org/eclipse/updates/${env.RELEASE_VER.trim()}-Y-builds'>https://download.eclipse.org/eclipse/updates/${env.RELEASE_VER.trim()}-Y-builds</a><br><br>Specific (simple) site repository:<br> <a href='https://download.eclipse.org/eclipse/updates/${env.RELEASE_VER.trim()}-Y-builds/${env.BUILD_IID.trim()}'>https://download.eclipse.org/eclipse/updates/${env.RELEASE_VER.trim()}-Y-builds/${env.BUILD_IID.trim()}</a><br><br>Equinox downloads:<br> <a href='https://download.eclipse.org/equinox/drops/${env.BUILD_IID.trim()}'>https://download.eclipse.org/equinox/drops/${env.BUILD_IID.trim()}</a><br><br>",
subject: "${env.BUILD_VERSION} Y-Build: ${env.BUILD_IID.trim()} ${env.POM_UPDATES_SUBJECT.trim()} ${env.COMPARATOR_ERRORS_SUBJECT.trim()}",
from:"[email protected]"
}
}
}
''')
}
}
}
}