-
Notifications
You must be signed in to change notification settings - Fork 11
/
.gitlab-ci.yml
582 lines (512 loc) · 12.6 KB
/
.gitlab-ci.yml
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
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
## Please do not change this file.
## Doing so will unfortunately create unnesseccary merge conflicts between branches and the fork, and nordugrid/arc version of this file.
## To have the automatic builds work on your fork, check that the runner is enabled in your fork: Settings->CI/CD->Runner settings
stages:
- build
- deploy
- check_deploy
variables:
OS_V: ''
ARC_IMAGE: ''
BUILD_VOL: ''
BROWSER: ''
BUILD_IMAGE: ''
BUILD_DIR: ''
#############################################################
## BUILDS (BOTH FORKS AND MAIN REPO) ##
#############################################################
.template_build_rhel: &template_build_rhel
stage: build
image: $BUILD_IMAGE
script:
- echo "$(date +%Y%m%d%H%M%S)" > VERSION
- yum update -y
- ./autogen.sh
- ./configure
- yum-builddep nordugrid-arc.spec -y
- echo "Preparing and running rpmbuild"
- mkdir -p rpmbuild/{SOURCES,BUILD,RPMS,SRPMS}
- make dist
- VERSION=`cat VERSION`
- mv nordugrid-arc-${VERSION}.tar.gz rpmbuild/SOURCES
- rpmbuild -D "_topdir $CI_PROJECT_DIR/rpmbuild" -ba nordugrid-arc.spec
artifacts:
when: on_success
expire_in: 3 days
paths:
- $CI_PROJECT_DIR/rpmbuild/SRPMS/
- $CI_PROJECT_DIR/rpmbuild/RPMS/noarch/
- $CI_PROJECT_DIR/rpmbuild/RPMS/x86_64/
allow_failure: false
tags:
- build
allow_failure: false
.template_build_rhel9: &template_build_rhel9
stage: build
image: $BUILD_IMAGE
script:
- echo "$(date +%Y%m%d%H%M%S)" > VERSION
- dnf remove -y dyninst
- dnf install -y dyninst
- dnf builddep nordugrid-arc -y
- ./autogen.sh
- ./configure
- dnf builddep nordugrid-arc.spec -y
- echo "Preparing and running rpmbuild"
- mkdir -p rpmbuild/{SOURCES,BUILD,RPMS,SRPMS}
- make dist
- VERSION=`cat VERSION`
- mv nordugrid-arc-${VERSION}.tar.gz rpmbuild/SOURCES
- rpmbuild -D "_topdir $CI_PROJECT_DIR/rpmbuild" -ba nordugrid-arc.spec
artifacts:
when: on_success
expire_in: 3 days
paths:
- $CI_PROJECT_DIR/rpmbuild/SRPMS/
- $CI_PROJECT_DIR/rpmbuild/RPMS/noarch/
- $CI_PROJECT_DIR/rpmbuild/RPMS/x86_64/
allow_failure: false
tags:
- build
allow_failure: false
.template_build_deb: &template_build_deb
stage: build
image: $BUILD_IMAGE
script:
- apt-get update -y
- echo "6.99.9" > VERSION
- ./autogen.sh
- ./configure
- make dist
- VERSION=`cat VERSION`
- mv nordugrid-arc-${VERSION}.tar.gz nordugrid-arc_${VERSION}.orig.tar.gz
- tar -z -x -f nordugrid-arc_${VERSION}.orig.tar.gz
- cd nordugrid-arc-${VERSION}
- dpkg-buildpackage -S -us -uc -d
- apt-get build-dep ../nordugrid-arc_${VERSION}-1.dsc -y
- dpkg-buildpackage -b -us -uc
- echo "Delete dbgsym debs to save space"
- rm -f ../*-dbgsym_*.deb
tags:
- build
artifacts:
when: on_success
expire_in: 3 days
paths:
- $CI_PROJECT_DIR/*.orig.tar.gz
- $CI_PROJECT_DIR/*.debian.tar.*
- $CI_PROJECT_DIR/*.dsc
- $CI_PROJECT_DIR/*.deb
allow_failure: false
###############
# CENTOS 7
###############
build_el7:
extends: .template_build_rhel
variables:
BUILD_IMAGE: maikenp/arc-build-centos7
####################
# CENTOS STREAM 9
####################
build_el9:
extends: .template_build_rhel9
variables:
BUILD_IMAGE: maikenp/arc-build-cs9
###############
# DEBIAN 10
###############
build_deb10:
extends: .template_build_deb
variables:
BUILD_IMAGE: maikenp/arc-build-debian10
###############
# DEBIAN 11
###############
build_deb11:
extends: .template_build_deb
variables:
BUILD_IMAGE: maikenp/arc-build-debian11
###############
# DEBIAN 12
###############
build_deb12:
extends: .template_build_deb
variables:
BUILD_IMAGE: maikenp/arc-build-debian12
##################
# UBUNTU 20.04
##################
build_ubuntu2004:
extends: .template_build_deb
variables:
BUILD_IMAGE: maikenp/arc-build-ubuntu2004
##################
# UBUNTU 22.04
##################
build_ubuntu2204:
extends: .template_build_deb
variables:
BUILD_IMAGE: maikenp/arc-build-ubuntu2204
#############################################################
## DEPLOY ##
#############################################################
.deploy: &deploy
stage: deploy
image: docker:stable
before_script:
- DEPLOY_CONTAINER=$OS_V_`date +%Y%m%dT%H%M`
- docker pull $ARC_IMAGE
- GITLAB_CONTAINER=$(docker ps | awk 'FNR==2' | awk '{print $NF}')
- mkdir -p $BUILD_VOL
- cp -r $BUILD_DIR $BUILD_VOL
- ls -lhrt $BUILD_VOL
- echo '*************** Should be nothing at this point in /arc-logs - ls shows:'
- ls -lhrt /arc-logs
- echo 'Just removing files just in case'
- rm -rf /arc-logs/*
- rm -rf /arc-testlogs/*
script:
- echo "*************>> Starting - inner container"
- docker run
--name=$DEPLOY_CONTAINER
--volumes-from $GITLAB_CONTAINER
-v "/$BUILD_VOL:/$BUILD_VOL:rw"
-v "/arc-testlogs:/arc-testlogs:rw"
-v "/arc-logs:/arc-logs:rw"
--publish 443
--publish 2811
--publish 9000-9002
--publish 9000-9002/udp
--rm $ARC_IMAGE
- echo "*************>> Done - back from inner container - starting cleanup and artifcats copying"
- ls -lhrt /arc-logs
- ls -lhrt /arc-testlogs
- cat /arc-testlogs/testresults.txt
- cp -r /arc-logs $CI_PROJECT_DIR
- cp -r /arc-testlogs $CI_PROJECT_DIR
- ls -lhrt $CI_PROJECT_DIR/arc-logs
- ls -lhrt $CI_PROJECT_DIR/arc-testlogs
- rm -rf /arc-logs/*
- rm -rf /arc-testlogs/*
- rm -rf $BUILD_VOL/*
artifacts:
when: always
paths:
- $CI_PROJECT_DIR/arc-logs/
- $CI_PROJECT_DIR/arc-testlogs/
allow_failure: true
##################
# CENTOS 7
##################
deploy_el7:
extends: .deploy
variables:
OS_V: el7
ARC_IMAGE: maikenp/arc-deploy-centos7
BUILD_VOL: /rpmbuild
BUILD_DIR: $CI_PROJECT_DIR/$BUILD_VOL/*
tags:
- 158.39.201.67
- deploy
needs:
- job: build_el7
artifacts: true
#####################
# CENTOS STREAM 9
#####################
deploy_el9:
extends: .deploy
variables:
OS_V: el9
ARC_IMAGE: maikenp/arc-deploy-cs9
BUILD_VOL: /rpmbuild
BUILD_DIR: $CI_PROJECT_DIR/$BUILD_VOL/*
tags:
- 158.39.201.179
- deploy
needs:
- job: build_el9
artifacts: true
##################
# DEBIAN 10
##################
deploy_deb10:
extends: .deploy
variables:
OS_V: deb10
ARC_IMAGE: maikenp/arc-deploy-debian10
BUILD_VOL: /build
BUILD_DIR: $CI_PROJECT_DIR/*.deb
tags:
- 158.39.75.5
- deploy
needs:
- job: build_deb10
artifacts: true
##################
# DEBIAN 11
##################
deploy_deb11:
extends: .deploy
variables:
OS_V: deb11
ARC_IMAGE: maikenp/arc-deploy-debian11
BUILD_VOL: /build
BUILD_DIR: $CI_PROJECT_DIR/*.deb
tags:
- 158.39.75.5
- deploy
needs:
- job: build_deb11
artifacts: true
##################
# DEBIAN 12
##################
deploy_deb12:
extends: .deploy
variables:
OS_V: deb12
ARC_IMAGE: maikenp/arc-deploy-debian12
BUILD_VOL: /build
BUILD_DIR: $CI_PROJECT_DIR/*.deb
tags:
- 158.39.75.5
- deploy
needs:
- job: build_deb12
artifacts: true
##################
# UBUNTU 20.04
##################
deploy_ubuntu2004:
extends: .deploy
variables:
OS_V: ubuntu2004
ARC_IMAGE: maikenp/arc-deploy-ubuntu2004
BUILD_VOL: /build
BUILD_DIR: $CI_PROJECT_DIR/*.deb
tags:
- 158.39.201.198
- deploy
needs:
- job: build_ubuntu2004
artifacts: true
##################
# UBUNTU 22.04
##################
deploy_ubuntu2204:
extends: .deploy
variables:
OS_V: ubuntu2204
ARC_IMAGE: maikenp/arc-deploy-ubuntu2204
BUILD_VOL: /build
BUILD_DIR: $CI_PROJECT_DIR/*.deb
tags:
- 158.39.201.198
- deploy
needs:
- job: build_ubuntu2204
artifacts: true
#############################################################
## CHECK DEPLOY ##
#############################################################
.job_template_assert:
image: maikenp/arc-deploy-check
stage: check_deploy
variables:
TESTTYPE: ''
script:
- ls $CI_PROJECT_DIR/arc-testlogs/
- cp $CI_PROJECT_DIR/arc-testlogs/testresults.txt /
- cat /testresults.txt
- python3 /asserttest.py $TESTTYPE
tags:
- generic
############################
##### EL7 DEPLOY CHECK
############################
gridftp_el7_deploytest:
extends: .job_template_assert
variables:
TESTTYPE: 'gridftp'
needs:
- job: deploy_el7
artifacts: true
emies_el7_deploytest:
extends: .job_template_assert
variables:
TESTTYPE: 'emies'
needs:
- job: deploy_el7
artifacts: true
arcrest_el7_deploytest:
extends: .job_template_assert
variables:
TESTTYPE: 'arcrest'
needs:
- job: deploy_el7
artifacts: true
arcconf_el7_deploytest:
extends: .job_template_assert
variables:
TESTTYPE: 'arcconf'
needs:
- job: deploy_el7
artifacts: true
############################
##### EL9 DEPLOY CHECK
############################
gridftp_el9_deploytest:
extends: .job_template_assert
variables:
TESTTYPE: 'gridftp'
needs:
- job: deploy_el9
artifacts: true
emies_el9_deploytest:
extends: .job_template_assert
variables:
TESTTYPE: 'emies'
needs:
- job: deploy_el9
artifacts: true
arcrest_el9_deploytest:
extends: .job_template_assert
variables:
TESTTYPE: 'arcrest'
needs:
- job: deploy_el9
artifacts: true
arcconf_el9_deploytest:
extends: .job_template_assert
variables:
TESTTYPE: 'arcconf'
needs:
- job: deploy_el9
artifacts: true
############################
##### DEB10 DEPLOY CHECK
############################
gridftp_deb10_deploytest:
extends: .job_template_assert
variables:
TESTTYPE: 'gridftp'
needs:
- job: deploy_deb10
artifacts: true
emies_deb10_deploytest:
extends: .job_template_assert
variables:
TESTTYPE: 'emies'
needs:
- job: deploy_deb10
artifacts: true
arcrest_deb10_deploytest:
extends: .job_template_assert
variables:
TESTTYPE: 'arcrest'
needs:
- job: deploy_deb10
artifacts: true
arcconf_deb10_deploytest:
extends: .job_template_assert
variables:
TESTTYPE: 'arcconf'
needs:
- job: deploy_deb10
artifacts: true
############################
##### DEB11 DEPLOY CHECK
############################
gridftp_deb11_deploytest:
extends: .job_template_assert
variables:
TESTTYPE: 'gridftp'
needs:
- job: deploy_deb11
artifacts: true
emies_deb11_deploytest:
extends: .job_template_assert
variables:
TESTTYPE: 'emies'
needs:
- job: deploy_deb11
artifacts: true
arcrest_deb11_deploytest:
extends: .job_template_assert
variables:
TESTTYPE: 'arcrest'
needs:
- job: deploy_deb11
artifacts: true
arcconf_deb11_deploytest:
extends: .job_template_assert
variables:
TESTTYPE: 'arcconf'
needs:
- job: deploy_deb11
artifacts: true
############################
##### UBUNTU DEPLOY CHECK
############################
gridftp_ubuntu2004_deploytest:
extends: .job_template_assert
variables:
TESTTYPE: 'gridftp'
stage: check_deploy
needs:
- job: deploy_ubuntu2004
artifacts: true
emies_ubuntu2004_deploytest:
extends: .job_template_assert
variables:
TESTTYPE: 'emies'
needs:
- job: deploy_ubuntu2004
artifacts: true
arcrest_ubuntu2004_deploytest:
extends: .job_template_assert
variables:
TESTTYPE: 'arcrest'
needs:
- job: deploy_ubuntu2004
artifacts: true
arcconf_ubuntu2004_deploytest:
extends: .job_template_assert
variables:
TESTTYPE: 'arcconf'
needs:
- job: deploy_ubuntu2004
artifacts: true
############################
##### UBUNTU DEPLOY CHECK
############################
gridftp_ubuntu2204_deploytest:
extends: .job_template_assert
variables:
TESTTYPE: 'gridftp'
stage: check_deploy
needs:
- job: deploy_ubuntu2204
artifacts: true
emies_ubuntu2204_deploytest:
extends: .job_template_assert
variables:
TESTTYPE: 'emies'
needs:
- job: deploy_ubuntu2204
artifacts: true
arcrest_ubuntu2204_deploytest:
extends: .job_template_assert
variables:
TESTTYPE: 'arcrest'
needs:
- job: deploy_ubuntu2204
artifacts: true
arcconf_ubuntu2204_deploytest:
extends: .job_template_assert
variables:
TESTTYPE: 'arcconf'
needs:
- job: deploy_ubuntu2204
artifacts: true