.gitlab-ci.yml 23.2 KB
Newer Older
Dainius Simelevicius's avatar
Dainius Simelevicius committed
1
2
variables:
  EXTERN_PACKAGES: "extern/oracle extern/dim extern/smi extern/yui extern/caen/a2818 extern/caen/a3818 extern/caen/CAENUSBdrvB extern/caen/caenvmelib extern/caen/caencomm extern/caen/caenbridgeupgrade extern/caen/caenupgrader"
3
  WORKSUITE_PACKAGES: "xdaq2rc interface/evb interface/shared evb jobcontrol xpci/drv xpci hal/generic hal/utilities hal/busAdapter/dummy hal/busAdapter/caen hal/busAdapter/pci hal/PyHAL pheaps/drv/cmem_rcc pheaps jal/jtagChain jal/jtagController jal/jtagSVFSequencer ttc/utils ttc/monitoring ttc/ltc ttc/ttcci tts/ttsbase tts/atts tts/cpcibase tts/fmmtd tts/ipcutils tts/fmm tts/fmmcontroller tts/fmmdbi tts/fmmtester d2s/utils d2s/fedemulator d2s/gtpe d2s/gtpecontroller d2s/firmwareloader fedstreamer fedkit ferol ferol40 psx/sapi psx/mapi psx psx/watchdog sentinel sentinel/utils sentinel/probe sentinel/sentineld sentinel/tester sentinel/bridge2g sentinel/spotlight2g sentinel/spotlightocci sentinel/arc/utils sentinel/arc tstore/utils tstore/client tstore tstore/api xmas/admin xmas/heartbeat xmas/heartbeat/probe xmas/heartbeat/heartbeatd xmas/utils xmas/sensord xmas/probe xmas/tester xmas/bridge2g xmas/slash2g xmas/store2g xmas/smarthub ibvla pt/udapl pt/ibv gevb2g es/api es/xtreme es/xbeat elastic/api elastic/timestream amc13controller"
Dainius Simelevicius's avatar
Dainius Simelevicius committed
4
5
  RPM_REPO_DIR: "/tmp/$CI_PROJECT_NAME/$CI_JOB_NAME/repo"
  YUM_DIR: "/tmp/$CI_PROJECT_NAME/$CI_COMMIT_REF_NAME/cc7/x86_64/RPMS"
6
  DOCKER_IMAGE: "gitlab-registry.cern.ch/cmsos/docker/docker-image-cmsos-15-cc7-x86_64-worksuite:1.0.0.0"
7
8
9
  ARTIFACT_PREREQUISITE_DIR: "$CI_PROJECT_DIR/prerequisites/"
  ARTIFACT_DISTRIBUTED_DIR: "$CI_PROJECT_DIR/distributed/rpm/"
  ARTIFACT_REQUIRED_DIR: "$CI_PROJECT_DIR/required/rpm/"
10

Dainius Simelevicius's avatar
Dainius Simelevicius committed
11
12
13
stages:
    - setup
    - build
14
    - validate
Dainius Simelevicius's avatar
Dainius Simelevicius committed
15
16
17
18
19
20
21
    - distribute
    - staging
    - production

prepare:
  stage: setup
  script:
22
23
24
25
26
27
28
29
30
#    - export
    - mkdir -p $ARTIFACT_PREREQUISITE_DIR
    - mkdir -p $ARTIFACT_REQUIRED_DIR
    - mkdir -p $ARTIFACT_DISTRIBUTED_DIR
    - touch  $ARTIFACT_PREREQUISITE_DIR/marktime #create marktime file as reference time
    - export MARK_TIME=$(date -r $ARTIFACT_PREREQUISITE_DIR/marktime '+%s')
    - stat $ARTIFACT_PREREQUISITE_DIR/marktime
    - date -r $ARTIFACT_PREREQUISITE_DIR/marktime '+%Y-%m-%d %H:%M:%S'
    - date -r $ARTIFACT_PREREQUISITE_DIR/marktime '+%s'
Dainius Simelevicius's avatar
Dainius Simelevicius committed
31
32
  artifacts:
    paths:
33
34
35
      - $ARTIFACT_PREREQUISITE_DIR
      - $ARTIFACT_REQUIRED_DIR
      - $ARTIFACT_DISTRIBUTED_DIR
Dainius Simelevicius's avatar
Dainius Simelevicius committed
36
  tags:
37
    - cmsos-cc7-x86_64-tag
Dainius Simelevicius's avatar
Dainius Simelevicius committed
38
39
40
41
42
  except:
    - pushes

.build_package_template: &build_package_definition  # Hidden key that defines an anchor named 'build_package_definition'
  stage: build
43
  image: $DOCKER_IMAGE
Dainius Simelevicius's avatar
Dainius Simelevicius committed
44
45
46
  dependencies:
    - prepare
  script:
47
    - source /opt/rh/devtoolset-8/enable
48
    - gcc --version
Dainius Simelevicius's avatar
Dainius Simelevicius committed
49
    - export RPM_RELEASE_NAME=$CI_COMMIT_REF_NAME
50
    - export MARK_TIME=$(date -r $ARTIFACT_PREREQUISITE_DIR/marktime '+%s')
51
    - export RPM_BUILD_NUMBER="0."$MARK_TIME
Dainius Simelevicius's avatar
Dainius Simelevicius committed
52
53
54
    - export OPERATION_TYPE=$(echo $CI_COMMIT_REF_NAME | awk '{split($0,a,"_"); print a[1]}')
    - export RELEASE_NUMBER=$(echo $CI_COMMIT_REF_NAME | awk '{split($0,a,"_"); print a[2]}')
    - export BUILD_NUMBER=$(echo $CI_COMMIT_REF_NAME | awk '{split($0,a,"_"); print a[5]}')
55
    - if [ "$OPERATION_TYPE" == "release" -a "$BUILD_NUMBER" == "0" ]; then echo "Releases should use build number >= 1! Exiting..."; exit 1; fi
Dainius Simelevicius's avatar
Dainius Simelevicius committed
56
57
58
59
60
61
62
    - if [ "$OPERATION_TYPE" == "release" ]; then export RPM_RELEASE_NAME="r"$RELEASE_NUMBER; export RPM_BUILD_NUMBER=$BUILD_NUMBER; fi
    - if [ -v DEPENDENCY_LIST ]; then echo $DEPENDENCY_LIST; else export DEPENDENCY_LIST=""; echo $DEPENDENCY_LIST; fi
    - if [ -v RPM_LIST ]; then echo $RPM_LIST; else export RPM_LIST="$CI_JOB_NAME"; echo $RPM_LIST; fi
    - export PACKAGE_LIST="$DEPENDENCY_LIST $RPM_LIST"
    - echo $PACKAGE_LIST
    - echo "make rpm PACKAGES="$CI_JOB_NAME" PACKAGE_RELEASE="$RPM_RELEASE_NAME" BUILD_VERSION="$RPM_BUILD_NUMBER" BUILD_SUPPORT=build PROJECT_NAME="$CI_PROJECT_NAME
    - export XDAQ_ROOT=/opt/xdaq
63
    - export PVSS_II_HOME=/opt/WinCC_OA/3.16
Dainius Simelevicius's avatar
Dainius Simelevicius committed
64
    - echo "calling make with PACKAGES="$CI_JOB_NAME" PACKAGE_RELEASE="$RPM_RELEASE_NAME" BUILD_VERSION="$RPM_BUILD_NUMBER" BUILD_SUPPORT=build PROJECT_NAME="$CI_PROJECT_NAME
65
    - make PACKAGES="$PACKAGE_LIST"
66
67
68
    - make rpm PACKAGES="$PACKAGE_LIST" PACKAGE_RELEASE=$RPM_RELEASE_NAME BUILD_VERSION=$RPM_BUILD_NUMBER
    - make installrpm PACKAGES="$RPM_LIST" INSTALL_PREFIX=$(dirname "$ARTIFACT_DISTRIBUTED_DIR")
    - make installrpm PACKAGES="$DEPENDENCY_LIST" INSTALL_PREFIX=$(dirname "$ARTIFACT_REQUIRED_DIR")
Dainius Simelevicius's avatar
Dainius Simelevicius committed
69
70
  artifacts:
    paths:
71
72
      - $ARTIFACT_DISTRIBUTED_DIR
      - $ARTIFACT_REQUIRED_DIR
Dainius Simelevicius's avatar
Dainius Simelevicius committed
73
  tags:
74
    - cmsos-cc7-x86_64-tag
Dainius Simelevicius's avatar
Dainius Simelevicius committed
75
76
77
  when: manual
  except:
    - pushes
78
79
80
81
82
83

skip-build:
  stage: build
  dependencies:
    - prepare
  script:
84
    - echo "Skipping build stage"
85
86
  artifacts:
    paths:
87
88
      - $ARTIFACT_DISTRIBUTED_DIR
      - $ARTIFACT_REQUIRED_DIR
89
  tags:
90
    - cmsos-cc7-x86_64-tag
91
92
93
94
  when: manual
  except:
    - pushes

Dainius Simelevicius's avatar
Dainius Simelevicius committed
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
all:
  before_script:
    - export RPM_LIST="$EXTERN_PACKAGES $WORKSUITE_PACKAGES"
  <<: *build_package_definition

extern/oracle:
  before_script:
  <<: *build_package_definition

extern/dim:
  before_script:
  <<: *build_package_definition

extern/smi:
  before_script:
    - export DEPENDENCY_LIST="extern/dim"
  <<: *build_package_definition

extern/yui:
  before_script:
  <<: *build_package_definition

extern/caen/a2818:
  before_script:
  <<: *build_package_definition

extern/caen/a3818:
  before_script:
  <<: *build_package_definition

extern/caen/CAENUSBdrvB:
  before_script:
  <<: *build_package_definition

extern/caen/caenvmelib:
  before_script:
  <<: *build_package_definition

extern/caen/caencomm:
  before_script:
  <<: *build_package_definition

extern/caen/caenbridgeupgrade:
  before_script:
  <<: *build_package_definition

extern/caen/caenupgrader:
  before_script:
  - export DEPENDENCY_LIST="extern/caen/caenvmelib extern/caen/caencomm"
  <<: *build_package_definition
145

Dainius Simelevicius's avatar
Dainius Simelevicius committed
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
xdaq2rc:
  before_script:
  <<: *build_package_definition

interface/evb:
  before_script:
  <<: *build_package_definition

interface/shared:
  before_script:
  <<: *build_package_definition

evb:
  before_script:
  - export DEPENDENCY_LIST="xdaq2rc interface/shared"
  <<: *build_package_definition

jobcontrol:
  before_script:
  <<: *build_package_definition

xpci/drv:
  before_script:
  <<: *build_package_definition

xpci:
  before_script:
  <<: *build_package_definition

hal/generic:
  before_script:
  <<: *build_package_definition

hal/utilities:
  before_script:
  <<: *build_package_definition

hal/busAdapter/dummy:
  before_script:
  <<: *build_package_definition

hal/busAdapter/caen:
  before_script:
  - export DEPENDENCY_LIST="extern/caen/caenvmelib"
  <<: *build_package_definition

hal/busAdapter/pci:
  before_script:
  - export DEPENDENCY_LIST="xpci"
  <<: *build_package_definition

197
198
hal/PyHAL:
  before_script:
199
  - export DEPENDENCY_LIST="xpci hal/generic hal/busAdapter/pci"
200
201
  <<: *build_package_definition

Dainius Simelevicius's avatar
Dainius Simelevicius committed
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
pheaps/drv/cmem_rcc:
  before_script:
  <<: *build_package_definition

pheaps:
  before_script:
  <<: *build_package_definition

jal/jtagChain:
  before_script:
  <<: *build_package_definition

jal/jtagController:
  before_script:
  <<: *build_package_definition

jal/jtagSVFSequencer:
  before_script:
  <<: *build_package_definition

d2s/fedemulator:
  before_script:
    - export DEPENDENCY_LIST="xpci hal/busAdapter/pci hal/generic"
  <<: *build_package_definition

d2s/gtpe:
  before_script:
    - export DEPENDENCY_LIST="tts/ttsbase tts/ipcutils xpci hal/busAdapter/dummy hal/busAdapter/pci hal/generic"
  <<: *build_package_definition

d2s/gtpecontroller:
  before_script:
    - export DEPENDENCY_LIST="tts/ttsbase tts/ipcutils xpci hal/busAdapter/dummy hal/busAdapter/pci hal/generic d2s/gtpe"
  <<: *build_package_definition

d2s/firmwareloader:
  before_script:
    - export DEPENDENCY_LIST="tts/ttsbase tts/ipcutils xpci hal/busAdapter/pci hal/generic jal/jtagSVFSequencer jal/jtagController jal/jtagChain"
  <<: *build_package_definition

d2s/utils:
  before_script:
    - export DEPENDENCY_LIST="xdaq2rc xpci hal/busAdapter/pci hal/generic tts/ipcutils"
  <<: *build_package_definition

fedstreamer:
  before_script:
  <<: *build_package_definition

fedkit:
  before_script:
  <<: *build_package_definition

ferol:
  before_script:
257
    - export DEPENDENCY_LIST="xdaq2rc xpci hal/generic hal/busAdapter/pci hal/busAdapter/dummy tts/ipcutils d2s/utils"
Dainius Simelevicius's avatar
Dainius Simelevicius committed
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
  <<: *build_package_definition

ferol40:
  before_script:
    - export DEPENDENCY_LIST="xdaq2rc xpci hal/generic hal/busAdapter/pci hal/busAdapter/dummy tts/ipcutils d2s/utils"
  <<: *build_package_definition

psx/sapi:
  before_script:
    - export DEPENDENCY_LIST="extern/dim extern/smi"
  <<: *build_package_definition

psx/mapi:
  before_script:
    - export DEPENDENCY_LIST="extern/dim extern/smi"
  <<: *build_package_definition

psx:
  before_script:
    - export DEPENDENCY_LIST="extern/dim extern/smi"
  <<: *build_package_definition

psx/watchdog:
  before_script:
  <<: *build_package_definition

sentinel/spotlightocci:
  before_script:
    - export DEPENDENCY_LIST="extern/oracle"
  <<: *build_package_definition
288

Dainius Simelevicius's avatar
Dainius Simelevicius committed
289
290
291
292
sentinel:
  before_script:
    - export DEPENDENCY_LIST=""
  <<: *build_package_definition
293

Dainius Simelevicius's avatar
Dainius Simelevicius committed
294
295
296
297
sentinel/utils:
  before_script:
    - export DEPENDENCY_LIST=""
  <<: *build_package_definition
298

Dainius Simelevicius's avatar
Dainius Simelevicius committed
299
300
301
302
sentinel/probe:
  before_script:
    - export DEPENDENCY_LIST=""
  <<: *build_package_definition
303

Dainius Simelevicius's avatar
Dainius Simelevicius committed
304
305
306
307
sentinel/sentineld:
  before_script:
    - export DEPENDENCY_LIST=""
  <<: *build_package_definition
308

Dainius Simelevicius's avatar
Dainius Simelevicius committed
309
310
311
312
sentinel/tester:
  before_script:
    - export DEPENDENCY_LIST=""
  <<: *build_package_definition
313

Dainius Simelevicius's avatar
Dainius Simelevicius committed
314
315
316
317
sentinel/bridge2g:
  before_script:
    - export DEPENDENCY_LIST=""
  <<: *build_package_definition
318

Dainius Simelevicius's avatar
Dainius Simelevicius committed
319
320
321
322
sentinel/spotlight2g:
  before_script:
    - export DEPENDENCY_LIST=""
  <<: *build_package_definition
323

Dainius Simelevicius's avatar
Dainius Simelevicius committed
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
sentinel/arc/utils:
  before_script:
    - export DEPENDENCY_LIST="extern/oracle"
  <<: *build_package_definition

sentinel/arc:
  before_script:
    - export DEPENDENCY_LIST="extern/oracle"
  <<: *build_package_definition

tstore/utils:
  before_script:
    - export DEPENDENCY_LIST="extern/oracle"
  <<: *build_package_definition

tstore/client:
  before_script:
    - export DEPENDENCY_LIST="extern/oracle"
  <<: *build_package_definition

tstore:
  before_script:
    - export DEPENDENCY_LIST="extern/oracle"
  <<: *build_package_definition

tstore/api:
  before_script:
  <<: *build_package_definition
352

Dainius Simelevicius's avatar
Dainius Simelevicius committed
353
354
355
xmas/admin:
  before_script:
  <<: *build_package_definition
356

Dainius Simelevicius's avatar
Dainius Simelevicius committed
357
358
359
xmas/heartbeat:
  before_script:
  <<: *build_package_definition
360

Dainius Simelevicius's avatar
Dainius Simelevicius committed
361
362
363
xmas/heartbeat/probe:
  before_script:
  <<: *build_package_definition
364

Dainius Simelevicius's avatar
Dainius Simelevicius committed
365
366
367
xmas/heartbeat/heartbeatd:
  before_script:
  <<: *build_package_definition
368

Dainius Simelevicius's avatar
Dainius Simelevicius committed
369
370
371
xmas/utils:
  before_script:
  <<: *build_package_definition
372

Dainius Simelevicius's avatar
Dainius Simelevicius committed
373
374
375
xmas/sensord:
  before_script:
  <<: *build_package_definition
376

Dainius Simelevicius's avatar
Dainius Simelevicius committed
377
378
379
xmas/probe:
  before_script:
  <<: *build_package_definition
380

Dainius Simelevicius's avatar
Dainius Simelevicius committed
381
382
383
xmas/tester:
  before_script:
  <<: *build_package_definition
384

Dainius Simelevicius's avatar
Dainius Simelevicius committed
385
386
387
xmas/bridge2g:
  before_script:
  <<: *build_package_definition
388

Dainius Simelevicius's avatar
Dainius Simelevicius committed
389
390
391
392
393
394
395
xmas/slash2g:
  before_script:
  <<: *build_package_definition

xmas/store2g:
  before_script:
  <<: *build_package_definition
396

Dainius Simelevicius's avatar
Dainius Simelevicius committed
397
398
399
xmas/smarthub:
  before_script:
  <<: *build_package_definition
400

Dainius Simelevicius's avatar
Dainius Simelevicius committed
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
ibvla:
  before_script:
  <<: *build_package_definition

pt/udapl:
  before_script:
  <<: *build_package_definition

pt/ibv:
  before_script:
    - export DEPENDENCY_LIST="ibvla"
  <<: *build_package_definition

gevb2g:
  before_script:
  <<: *build_package_definition

ttc/utils:
  before_script:
    - export DEPENDENCY_LIST="extern/caen/caenvmelib hal/generic hal/utilities hal/busAdapter/dummy hal/busAdapter/caen"
  <<: *build_package_definition

ttc/monitoring:
  before_script:
  <<: *build_package_definition

427
428
429
430
431
ttc/ltc:
  before_script:
  - export DEPENDENCY_LIST="extern/caen/caenvmelib hal/generic hal/utilities hal/busAdapter/dummy hal/busAdapter/caen ttc/utils ttc/monitoring"
  <<: *build_package_definition

Dainius Simelevicius's avatar
Dainius Simelevicius committed
432
433
434
435
436
437
438
439
440
ttc/ttcci:
  before_script:
  - export DEPENDENCY_LIST="extern/caen/caenvmelib hal/generic hal/utilities hal/busAdapter/dummy hal/busAdapter/caen ttc/utils ttc/monitoring"
  <<: *build_package_definition

tts/atts:
  before_script:
  - export DEPENDENCY_LIST="xpci tts/ttsbase hal/generic hal/busAdapter/pci hal/busAdapter/dummy"
  <<: *build_package_definition
441

Dainius Simelevicius's avatar
Dainius Simelevicius committed
442
443
444
tts/cpcibase:
  before_script:
  <<: *build_package_definition
445

Dainius Simelevicius's avatar
Dainius Simelevicius committed
446
447
448
449
450
451
452
453
454
tts/fmm:
  before_script:
  - export DEPENDENCY_LIST="xpci tts/ttsbase hal/generic hal/busAdapter/pci hal/busAdapter/dummy tts/cpcibase tts/ipcutils tts/fmmtd"
  <<: *build_package_definition

tts/fmmcontroller:
  before_script:
  - export DEPENDENCY_LIST="xpci tts/ttsbase hal/generic hal/busAdapter/pci hal/busAdapter/dummy tts/cpcibase tts/ipcutils tts/fmmtd tts/fmm"
  <<: *build_package_definition
455

Dainius Simelevicius's avatar
Dainius Simelevicius committed
456
457
458
459
tts/fmmdbi:
  before_script:
  - export DEPENDENCY_LIST="extern/oracle"
  <<: *build_package_definition
460

Dainius Simelevicius's avatar
Dainius Simelevicius committed
461
462
463
tts/fmmtd:
  before_script:
  <<: *build_package_definition
464

Dainius Simelevicius's avatar
Dainius Simelevicius committed
465
466
467
tts/fmmtester:
  before_script:
  <<: *build_package_definition
468

Dainius Simelevicius's avatar
Dainius Simelevicius committed
469
470
471
tts/ipcutils:
  before_script:
  <<: *build_package_definition
472

Dainius Simelevicius's avatar
Dainius Simelevicius committed
473
474
475
tts/ttsbase:
  before_script:
  <<: *build_package_definition
476

Dainius Simelevicius's avatar
Dainius Simelevicius committed
477
478
479
es/api:
  before_script:
  <<: *build_package_definition
480

Dainius Simelevicius's avatar
Dainius Simelevicius committed
481
482
483
es/xtreme:
  before_script:
  <<: *build_package_definition
484

Dainius Simelevicius's avatar
Dainius Simelevicius committed
485
486
487
es/xbeat:
  before_script:
  <<: *build_package_definition
488

Dainius Simelevicius's avatar
Dainius Simelevicius committed
489
490
491
elastic/api:
  before_script:
  <<: *build_package_definition
492

Dainius Simelevicius's avatar
Dainius Simelevicius committed
493
494
495
elastic/timestream:
  before_script:
  <<: *build_package_definition
496
497
498

amc13controller:
  before_script:
499
  - export DEPENDENCY_LIST="xdaq2rc xpci hal/busAdapter/pci hal/generic tts/ipcutils d2s/utils"
500
501
  <<: *build_package_definition

502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
deploy:
  stage: validate
  image: $DOCKER_IMAGE
  dependencies:
    - all
    - skip-build
    - xdaq2rc
    - interface/evb
    - interface/shared
    - evb
    - jobcontrol
    - xpci/drv
    - xpci
    - hal/generic
    - hal/utilities
    - hal/busAdapter/dummy
    - hal/busAdapter/caen
    - hal/busAdapter/pci
520
    - hal/PyHAL
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
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
    - pheaps/drv/cmem_rcc
    - pheaps
    - jal/jtagChain
    - jal/jtagController
    - jal/jtagSVFSequencer
    - d2s/fedemulator
    - d2s/gtpe
    - d2s/gtpecontroller
    - d2s/firmwareloader
    - d2s/utils
    - fedstreamer
    - fedkit
    - ferol
    - ferol40
    - psx/sapi
    - psx/mapi
    - psx
    - psx/watchdog
    - sentinel
    - sentinel/utils
    - sentinel/probe
    - sentinel/sentineld
    - sentinel/tester
    - sentinel/bridge2g
    - sentinel/spotlight2g
    - sentinel/spotlightocci
    - sentinel/arc/utils
    - sentinel/arc
    - tstore/utils
    - tstore/client
    - tstore
    - tstore/api
    - xmas/admin
    - xmas/heartbeat
    - xmas/heartbeat/probe
    - xmas/heartbeat/heartbeatd
    - xmas/utils
    - xmas/sensord
    - xmas/probe
    - xmas/tester
    - xmas/bridge2g
    - xmas/slash2g
    - xmas/store2g
    - xmas/smarthub
    - ibvla
    - pt/udapl
    - pt/ibv
    - gevb2g
    - extern/oracle
    - extern/dim
    - extern/smi
    - extern/yui
    - extern/caen/a2818
    - extern/caen/a3818
    - extern/caen/CAENUSBdrvB
    - extern/caen/caenvmelib
    - extern/caen/caencomm
    - extern/caen/caenbridgeupgrade
    - extern/caen/caenupgrader
    - ttc/utils
    - ttc/monitoring
    - ttc/ttcci
    - tts/atts
    - tts/cpcibase
    - tts/fmm
    - tts/fmmcontroller
    - tts/fmmdbi
    - tts/fmmtd
    - tts/fmmtester
    - tts/ipcutils
    - tts/ttsbase
    - es/api
    - es/xtreme
    - es/xbeat
    - elastic/api
    - elastic/timestream
    - amc13controller
  script:
    - ls -la $ARTIFACT_REQUIRED_DIR
    - ls -la $ARTIFACT_DISTRIBUTED_DIR
    - if [ "$(ls -A $ARTIFACT_REQUIRED_DIR)" ]; then yum -y install $ARTIFACT_REQUIRED_DIR/*.rpm; else echo "No rpms in $ARTIFACT_REQUIRED_DIR directory"; fi
    - if [ "$(ls -A $ARTIFACT_DISTRIBUTED_DIR)" ]; then yum -y install $ARTIFACT_DISTRIBUTED_DIR/*.rpm; else echo "No rpms in $ARTIFACT_DISTRIBUTED_DIR) directory"; fi
  tags:
    - cmsos-cc7-x86_64-tag
  when: manual
  except:
    - pushes

Dainius Simelevicius's avatar
Dainius Simelevicius committed
609
610
611
612
git:
  stage: distribute
  dependencies:
    - all
613
    - skip-build
Dainius Simelevicius's avatar
Dainius Simelevicius committed
614
615
616
617
618
619
620
621
622
623
624
625
    - xdaq2rc
    - interface/evb
    - interface/shared
    - evb
    - jobcontrol
    - xpci/drv
    - xpci
    - hal/generic
    - hal/utilities
    - hal/busAdapter/dummy
    - hal/busAdapter/caen
    - hal/busAdapter/pci
626
    - hal/PyHAL
Dainius Simelevicius's avatar
Dainius Simelevicius committed
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
    - pheaps/drv/cmem_rcc
    - pheaps
    - jal/jtagChain
    - jal/jtagController
    - jal/jtagSVFSequencer
    - d2s/fedemulator
    - d2s/gtpe
    - d2s/gtpecontroller
    - d2s/firmwareloader
    - d2s/utils
    - fedstreamer
    - fedkit
    - ferol
    - ferol40
    - psx/sapi
    - psx/mapi
    - psx
    - psx/watchdog
645
646
647
648
649
650
651
    - sentinel
    - sentinel/utils
    - sentinel/probe
    - sentinel/sentineld
    - sentinel/tester
    - sentinel/bridge2g
    - sentinel/spotlight2g
Dainius Simelevicius's avatar
Dainius Simelevicius committed
652
653
654
655
656
657
658
    - sentinel/spotlightocci
    - sentinel/arc/utils
    - sentinel/arc
    - tstore/utils
    - tstore/client
    - tstore
    - tstore/api
659
660
661
662
663
664
665
666
667
668
    - xmas/admin
    - xmas/heartbeat
    - xmas/heartbeat/probe
    - xmas/heartbeat/heartbeatd
    - xmas/utils
    - xmas/sensord
    - xmas/probe
    - xmas/tester
    - xmas/bridge2g
    - xmas/slash2g
Dainius Simelevicius's avatar
Dainius Simelevicius committed
669
    - xmas/store2g
670
    - xmas/smarthub
Dainius Simelevicius's avatar
Dainius Simelevicius committed
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
    - ibvla
    - pt/udapl
    - pt/ibv
    - gevb2g
    - extern/oracle
    - extern/dim
    - extern/smi
    - extern/yui
    - extern/caen/a2818
    - extern/caen/a3818
    - extern/caen/CAENUSBdrvB
    - extern/caen/caenvmelib
    - extern/caen/caencomm
    - extern/caen/caenbridgeupgrade
    - extern/caen/caenupgrader
    - ttc/utils
    - ttc/monitoring
688
    - ttc/ltc
Dainius Simelevicius's avatar
Dainius Simelevicius committed
689
690
691
692
693
694
695
696
697
698
    - ttc/ttcci
    - tts/atts
    - tts/cpcibase
    - tts/fmm
    - tts/fmmcontroller
    - tts/fmmdbi
    - tts/fmmtd
    - tts/fmmtester
    - tts/ipcutils
    - tts/ttsbase
699
700
701
702
    - es/api
    - es/xtreme
    - es/xbeat
    - elastic/api
Dainius Simelevicius's avatar
Dainius Simelevicius committed
703
    - elastic/timestream
704
    - amc13controller
Dainius Simelevicius's avatar
Dainius Simelevicius committed
705
706
707
708
709
710
711
712
713
714
  script:
    - export RELEASE_NUMBER=$(echo $CI_COMMIT_REF_NAME | awk '{split($0,a,"_"); print a[2]}')
    - export SNAPSHOT_DIR=$RPM_REPO_DIR/$RELEASE_NUMBER/cc7/x86_64/RPMS/
    - rm -rf $RPM_REPO_DIR
    - git clone ssh://git@gitlab.cern.ch:7999/cmsos/$CI_PROJECT_NAME.yum.git $RPM_REPO_DIR
    - cd $RPM_REPO_DIR
    - mkdir -p $SNAPSHOT_DIR
    - git config --global user.name "$GITLAB_USER_NAME"
    - git config --global user.email $GITLAB_USER_EMAIL
    - git checkout master
715
    - rsync -a -v --ignore-existing $ARTIFACT_DISTRIBUTED_DIR $SNAPSHOT_DIR
Dainius Simelevicius's avatar
Dainius Simelevicius committed
716
717
718
719
720
721
722
723
    - createrepo -g $CI_PROJECT_DIR/yumgroups.xml $SNAPSHOT_DIR
    - cp $CI_PROJECT_DIR/yumgroups.xml $SNAPSHOT_DIR
    - git add --all . #stages removals too (this is important for the content of repodata)
    - git commit -m "New snapshot for $CI_COMMIT_REF_NAME"
    - git tag $CI_COMMIT_REF_NAME
    - git pull origin master
    - git push origin master --tags
  tags:
724
    - cmsos-cc7-x86_64-tag
Dainius Simelevicius's avatar
Dainius Simelevicius committed
725
726
727
728
729
730
731
732
733
734
735
  when: manual
  only:
    - /^release_.*$/
  except:
    - pushes
    - branches

yum:
  stage: distribute
  dependencies:
    - prepare
736
    - skip-build
Dainius Simelevicius's avatar
Dainius Simelevicius committed
737
738
739
740
741
742
743
744
745
746
747
748
749
    - all
    - xdaq2rc
    - interface/evb
    - interface/shared
    - evb
    - jobcontrol
    - xpci/drv
    - xpci
    - hal/generic
    - hal/utilities
    - hal/busAdapter/dummy
    - hal/busAdapter/caen
    - hal/busAdapter/pci
750
    - hal/PyHAL
Dainius Simelevicius's avatar
Dainius Simelevicius committed
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
    - pheaps/drv/cmem_rcc
    - pheaps
    - jal/jtagChain
    - jal/jtagController
    - jal/jtagSVFSequencer
    - d2s/fedemulator
    - d2s/gtpe
    - d2s/gtpecontroller
    - d2s/firmwareloader
    - d2s/utils
    - fedstreamer
    - fedkit
    - ferol
    - ferol40
    - psx/sapi
    - psx/mapi
    - psx
    - psx/watchdog
769
770
771
772
773
774
775
    - sentinel
    - sentinel/utils
    - sentinel/probe
    - sentinel/sentineld
    - sentinel/tester
    - sentinel/bridge2g
    - sentinel/spotlight2g
Dainius Simelevicius's avatar
Dainius Simelevicius committed
776
777
778
779
780
781
782
783
    - sentinel/spotlightocci
    - sentinel/arc/utils
    - sentinel/arc
    - tstore/utils
    - tstore/client
    - tstore
    - tstore/api
    - xmas/store2g
784
785
786
787
788
789
790
791
792
    - xmas/admin
    - xmas/heartbeat
    - xmas/heartbeat/probe
    - xmas/heartbeat/heartbeatd
    - xmas/utils
    - xmas/sensord
    - xmas/probe
    - xmas/tester
    - xmas/bridge2g
Dainius Simelevicius's avatar
Dainius Simelevicius committed
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
    - xmas/slash2g
    - xmas/smarthub
    - ibvla
    - pt/udapl
    - pt/ibv
    - gevb2g
    - extern/oracle
    - extern/dim
    - extern/smi
    - extern/yui
    - extern/caen/a2818
    - extern/caen/a3818
    - extern/caen/CAENUSBdrvB
    - extern/caen/caenvmelib
    - extern/caen/caencomm
    - extern/caen/caenbridgeupgrade
    - extern/caen/caenupgrader
    - ttc/utils
    - ttc/monitoring
812
    - ttc/ltc
Dainius Simelevicius's avatar
Dainius Simelevicius committed
813
814
815
816
817
818
819
820
821
822
    - ttc/ttcci
    - tts/atts
    - tts/cpcibase
    - tts/fmm
    - tts/fmmcontroller
    - tts/fmmdbi
    - tts/fmmtd
    - tts/fmmtester
    - tts/ipcutils
    - tts/ttsbase
823
824
825
826
    - es/api
    - es/xtreme
    - es/xbeat
    - elastic/api
Dainius Simelevicius's avatar
Dainius Simelevicius committed
827
    - elastic/timestream
828
    - amc13controller
Dainius Simelevicius's avatar
Dainius Simelevicius committed
829
  script:
830
831
    - find $ARTIFACT_DISTRIBUTED_DIR -name "*.rpm" -exec touch -r $ARTIFACT_PREREQUISITE_DIR/marktime {} \; # touch artifacts
    - export MARK_TIME=$(date -r $ARTIFACT_PREREQUISITE_DIR/marktime '+%Y-%m-%d %H:%M:%S')
Dainius Simelevicius's avatar
Dainius Simelevicius committed
832
833
834
835
    - echo "Remove all RPMs newer than "$MARK_TIME
    - mkdir -p $YUM_DIR
    - find $YUM_DIR -name "*.rpm" -newermt "$MARK_TIME" -print  #replace -print with -delete when tested
    - find $YUM_DIR -name "*.rpm" -newermt "$MARK_TIME" -delete
836
    - rsync --archive --verbose --times $ARTIFACT_DISTRIBUTED_DIR $YUM_DIR
Dainius Simelevicius's avatar
Dainius Simelevicius committed
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
    - rm -rf $YUM_DIR/.olddata/
    - createrepo -g $CI_PROJECT_DIR/yumgroups.xml $YUM_DIR
    - cp $CI_PROJECT_DIR/yumgroups.xml $YUM_DIR
    # *****************************   IMPORTANT ***********************************************************
    # Repository is always managed locally on /tmp and then uploaded.
    # At this point a lftp command using SFTP to xdaq.web.cern.ch/x/xdaq/repo/ can be used to upload
    # RPMS to xdaq web site. No need for mount anymore. A secret variable for credentials XDAQ_LOGIN
    # can be used for  secure access of the  the website.
    # The remote repository could be used, when available, to initialize local repository, otherwise empty
    # *****************************   IMPORTANT ***********************************************************
    - echo $XDAQ_WEBSITE_HOST
    - echo $XDAQ_WEBSITE_PATH
    - echo "YUM_DIR="$YUM_DIR
    - export DISTRIBUTE_PATH=$XDAQ_WEBSITE_PATH/development/$CI_PROJECT_NAME/$CI_COMMIT_REF_NAME/cc7/x86_64/RPMS
    - lftp -u $XDAQ_WEBSITE_CREDENTIALS $XDAQ_WEBSITE_HOST -e "set ftp:ssl-protect-data true; set ftp:ssl-force true; set ssl:verify-certificate no; set ftp:use-hftp no; set ftp:proxy $XDAQ_WEBSITE_PROXY; rm -rf $DISTRIBUTE_PATH; mirror -R $YUM_DIR $DISTRIBUTE_PATH"
  environment:
    name: development
    url: http://$XDAQ_WEBSITE_HOST/xdaq/repo/development/$CI_PROJECT_NAME/$CI_COMMIT_REF_NAME/cc7/x86_64/RPMS/
  tags:
856
    - cmsos-cc7-x86_64-tag
Dainius Simelevicius's avatar
Dainius Simelevicius committed
857
858
859
860
  when: manual
  except:
    - pushes
    - /^release_.*$/
861

Dainius Simelevicius's avatar
Dainius Simelevicius committed
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
.release_template: &release_definition  # Hidden key that defines an anchor named 'release_definition'
  script:
    - export RELEASE_NUMBER=$(echo $CI_COMMIT_REF_NAME | awk '{split($0,a,"_"); print a[2]}')
    - rm -rf $RPM_REPO_DIR
    - git clone ssh://git@gitlab.cern.ch:7999/cmsos/$CI_PROJECT_NAME.yum.git $RPM_REPO_DIR
    - cd $RPM_REPO_DIR
    - git config --global user.name "$GITLAB_USER_NAME"
    - git config --global user.email $GITLAB_USER_EMAIL
    - git checkout $CI_COMMIT_REF_NAME
    - git tag --force $CI_JOB_NAME"_"$RELEASE_NUMBER
    - git pull origin master
    - git push origin master --tags --force
  environment:
    name: $CI_JOB_NAME
    url: https://gitlab.cern.ch/cmsos/$CI_PROJECT_NAME.yum
  tags:
878
    - cmsos-cc7-x86_64-tag
Dainius Simelevicius's avatar
Dainius Simelevicius committed
879
880
881
882
883
884
885
886
887
888
  when: manual
  only:
    - /^release_.*$/
  except:
    - branches
    - pushes

staging:
  stage: staging
  <<: *release_definition
889

Dainius Simelevicius's avatar
Dainius Simelevicius committed
890
891
892
production:
  stage: production
  <<: *release_definition