Apex: Change CSIT promotion start times
[releng.git] / jjb / apex / apex.yaml.j2
1 ---
2 - project:
3     name: 'apex'
4     project: 'apex'
5     jobs:
6       - 'apex-fetch-logs-{stream}'
7       - 'apex-runner-cperf-{stream}'
8       - 'apex-virtual-{stream}'
9       - 'apex-deploy-{platform}-{stream}'
10       - 'apex-daily-{stream}'
11       - 'apex-csit-promote-daily-{stream}-os-{os_version}-{topology}'
12       - 'apex-fdio-promote-daily-{stream}'
13       - 'apex-{scenario}-baremetal-{scenario_stream}'
14       - 'apex-testsuite-{scenario}-baremetal-{scenario_stream}'
15       - 'apex-upload-snapshot'
16       - 'apex-create-snapshot'
17       - 'apex-fetch-snap-info'
18       - 'apex-flex-daily-os-nosdn-nofeature-ha-{stream}'
19       - 'apex-dovetail-daily-os-nosdn-nofeature-ha-baremetal-danube'
20     # stream:    branch with - in place of / (eg. stable-arno)
21     # branch:    branch (eg. stable/arno)
22     stream:
23       - master: &master
24           branch: 'master'
25           gs-pathname: ''
26           build-slave: 'apex-build-master'
27           virtual-slave: 'apex-virtual-master'
28           baremetal-slave: 'apex-baremetal-master'
29           verify-scenario: 'os-nosdn-nofeature-noha'
30           scenario_stream: 'master'
31           disable_daily: false
32           disable_promote: false
33       - gambia: &gambia
34           branch: 'stable/gambia'
35           gs-pathname: '/gambia'
36           build-slave: 'apex-build-master'
37           virtual-slave: 'apex-virtual-master'
38           baremetal-slave: 'apex-baremetal-master'
39           verify-scenario: 'os-nosdn-nofeature-ha'
40           scenario_stream: 'gambia'
41           disable_daily: false
42           disable_promote: false
43       - fraser: &fraser
44           branch: 'stable/fraser'
45           gs-pathname: '/fraser'
46           build-slave: 'apex-build-master'
47           virtual-slave: 'apex-virtual-master'
48           baremetal-slave: 'apex-baremetal-master'
49           verify-scenario: 'os-nosdn-nofeature-ha'
50           scenario_stream: 'fraser'
51           disable_daily: false
52           disable_promote: true
53       - euphrates: &euphrates
54           branch: 'stable/euphrates'
55           gs-pathname: '/euphrates'
56           build-slave: 'apex-build-master'
57           virtual-slave: 'apex-virtual-master'
58           baremetal-slave: 'apex-baremetal-master'
59           verify-scenario: 'os-odl-nofeature-ha'
60           scenario_stream: 'euphrates'
61           disable_daily: true
62           disable_promote: true
63       - danube: &danube
64           branch: 'stable/danube'
65           gs-pathname: '/danube'
66           build-slave: 'apex-build-danube'
67           virtual-slave: 'apex-virtual-danube'
68           baremetal-slave: 'apex-baremetal-danube'
69           verify-scenario: 'os-odl_l3-nofeature-ha'
70           scenario_stream: 'danube'
71           disabled: true
72           disable_daily: true
73           disable_promote: true
74
75     scenario:
76       {%- for stream in scenarios %}
77       {%- for scenario in scenarios[stream] %}
78       - '{{scenario}}':
79           <<: *{{stream}}
80       {%- endfor %}
81       {%- endfor %}
82
83     platform:
84       - 'baremetal'
85       - 'virtual'
86
87     os_version:
88       - 'queens':
89           os_scenario: 'nofeature'
90           odl_branch: 'stable/oxygen'
91       - 'rocky':
92           os_scenario: 'rocky'
93           odl_branch: 'stable/oxygen'
94       - 'master':
95           os_scenario: 'nofeature'
96           odl_branch: 'stable/fluorine'
97
98     topology:
99       - 'noha'
100       - 'ha'
101       - 'noha-allinone'
102
103 # Fetch Logs Job
104 - job-template:
105     name: 'apex-fetch-logs-{stream}'
106
107     concurrent: true
108
109     disabled: false
110     scm:
111       - git-scm-gerrit
112     parameters:
113       - project-parameter:
114           project: '{project}'
115           branch: '{branch}'
116       - apex-parameter:
117           gs-pathname: '{gs-pathname}'
118     # yamllint enable rule:line-length
119     properties:
120       - logrotate-default
121       - throttle:
122           max-per-node: 1
123           max-total: 10
124           option: 'project'
125
126     builders:
127       - 'apex-fetch-logs'
128
129 - job-template:
130     name: 'apex-runner-cperf-{stream}'
131
132     # runner cperf job
133     project-type: 'multijob'
134     node: 'intel-pod2'
135
136     disabled: false
137
138     parameters:
139       - apex-parameter:
140           gs-pathname: '{gs-pathname}'
141       - project-parameter:
142           project: '{project}'
143           branch: '{branch}'
144       - string:
145           name: GIT_BASE
146           default: https://gerrit.opnfv.org/gerrit/$PROJECT
147           description: "Used for overriding the GIT URL coming from parameters macro."
148
149     scm:
150       - git-scm
151
152     properties:
153       - logrotate-default
154       - build-blocker:
155           use-build-blocker: false
156           blocking-level: 'NODE'
157           blocking-jobs:
158             - 'apex-deploy.*'
159       - throttle:
160           max-per-node: 1
161           max-total: 10
162           option: 'project'
163
164     builders:
165       - description-setter:
166           description: "Deployed on $NODE_NAME"
167       - multijob:
168           name: 'Baremetal Deploy'
169           condition: ALWAYS
170           projects:
171             - name: 'apex-deploy-baremetal-{stream}'
172               node-parameters: false
173               current-parameters: true
174               predefined-parameters: |
175                 GERRIT_BRANCH=$GERRIT_BRANCH
176                 GERRIT_REFSPEC=
177                 OPNFV_CLEAN=yes
178                 DEPLOY_SCENARIO={verify-scenario}
179               kill-phase-on: FAILURE
180               abort-all-job: true
181               git-revision: false
182       - multijob:
183           name: CPERF
184           condition: SUCCESSFUL
185           projects:
186             - name: 'cperf-apex-intel-pod2-daily-master'
187               node-parameters: true
188               current-parameters: false
189               predefined-parameters:
190                 DEPLOY_SCENARIO={verify-scenario}
191               kill-phase-on: NEVER
192               abort-all-job: false
193               git-revision: false
194
195 # Deploy job
196 - job-template:
197     name: 'apex-deploy-{platform}-{stream}'
198
199     concurrent: true
200
201     disabled: false
202     quiet-period: 30
203     scm:
204       - git-scm-gerrit
205
206     wrappers:
207       - timeout:
208           timeout: 140
209           fail: true
210
211     parameters:
212       - '{project}-{platform}-{stream}-defaults'
213       - project-parameter:
214           project: '{project}'
215           branch: '{branch}'
216       - apex-parameter:
217           gs-pathname: '{gs-pathname}'
218       - string:
219           name: DEPLOY_SCENARIO
220           default: '{verify-scenario}'
221           description: "Scenario to deploy with."
222       # yamllint disable rule:line-length
223       - string:
224           name: OPNFV_CLEAN
225           default: 'no'
226           description: "Use yes in lower case to invoke clean. Indicates if the deploy environment should be cleaned before deployment"
227
228     # yamllint enable rule:line-length
229     properties:
230       - logrotate-default
231       - build-blocker:
232           use-build-blocker: true
233           blocking-level: 'NODE'
234           blocking-jobs:
235             - 'apex-deploy.*'
236             - 'functest.*'
237             - 'yardstick.*'
238             - 'dovetail.*'
239             - 'storperf.*'
240             - 'odl-netvirt.*'
241       - throttle:
242           max-per-node: 1
243           max-total: 10
244           option: 'project'
245
246     builders:
247       - description-setter:
248           description: "Deployed on $NODE_NAME - Scenario: $DEPLOY_SCENARIO"
249       - 'apex-download-artifact'
250       - 'apex-deploy'
251       - 'clean-workspace'
252
253
254 # Virtual Deploy and Test
255 - job-template:
256     name: 'apex-virtual-{stream}'
257
258     project-type: 'multijob'
259
260     concurrent: true
261
262     disabled: false
263
264     scm:
265       - git-scm-gerrit
266
267     parameters:
268       - '{project}-defaults'
269       - '{project}-virtual-{stream}-defaults'
270       - 'functest-suite-parameter'
271       - project-parameter:
272           project: '{project}'
273           branch: '{branch}'
274       - apex-parameter:
275           gs-pathname: '{gs-pathname}'
276       - string:
277           name: DEPLOY_SCENARIO
278           default: '{verify-scenario}'
279           description: "Scenario to deploy with."
280       - string:
281           name: ARTIFACT_VERSION
282           default: dev
283           description: "Used for overriding the ARTIFACT_VERSION"
284
285     properties:
286       - logrotate-default
287       - build-blocker:
288           use-build-blocker: true
289           blocking-level: 'NODE'
290           blocking-jobs:
291             - 'apex-runner.*'
292             - 'apex-run.*'
293             - 'apex-virtual-.*'
294             - 'apex-verify-gate-.*'
295             - 'odl-netvirt.*'
296             - 'apex-.*-promote.*'
297       - throttle:
298           max-per-node: 1
299           max-total: 10
300           option: 'project'
301
302     builders:
303       - description-setter:
304           description: "Deployed on $NODE_NAME - Scenario: $DEPLOY_SCENARIO"
305       - multijob:
306           name: deploy-virtual
307           condition: SUCCESSFUL
308           projects:
309             - name: 'apex-deploy-virtual-{stream}'
310               current-parameters: false
311               predefined-parameters: |
312                 ARTIFACT_VERSION=$ARTIFACT_VERSION
313                 DEPLOY_SCENARIO=$DEPLOY_SCENARIO
314                 OPNFV_CLEAN=yes
315                 GERRIT_BRANCH=$GERRIT_BRANCH
316                 GERRIT_REFSPEC=$GERRIT_REFSPEC
317                 GERRIT_CHANGE_NUMBER=$GERRIT_CHANGE_NUMBER
318                 GERRIT_CHANGE_COMMIT_MESSAGE=$GERRIT_CHANGE_COMMIT_MESSAGE
319                 PROMOTE=$PROMOTE
320               node-parameters: true
321               kill-phase-on: FAILURE
322               abort-all-job: true
323               git-revision: true
324       - multijob:
325           name: functest-smoke
326           condition: ALWAYS
327           projects:
328             - name: 'functest-apex-virtual-suite-{stream}'
329               current-parameters: false
330               predefined-parameters: |
331                 DEPLOY_SCENARIO=$DEPLOY_SCENARIO
332                 FUNCTEST_MODE=$FUNCTEST_MODE
333                 FUNCTEST_SUITE_NAME=$FUNCTEST_SUITE_NAME
334                 GERRIT_BRANCH=$GERRIT_BRANCH
335                 GERRIT_REFSPEC=$GERRIT_REFSPEC
336                 GERRIT_CHANGE_NUMBER=$GERRIT_CHANGE_NUMBER
337                 GERRIT_CHANGE_COMMIT_MESSAGE=$GERRIT_CHANGE_COMMIT_MESSAGE
338               node-parameters: true
339               kill-phase-on: NEVER
340               abort-all-job: true
341               git-revision: false
342       - multijob:
343           name: apex-fetch-logs
344           projects:
345             - name: 'apex-fetch-logs-{stream}'
346               current-parameters: false
347               predefined-parameters: |
348                 GERRIT_BRANCH=$GERRIT_BRANCH
349                 GERRIT_REFSPEC=$GERRIT_REFSPEC
350                 GERRIT_CHANGE_NUMBER=$GERRIT_CHANGE_NUMBER
351                 GERRIT_CHANGE_COMMIT_MESSAGE=$GERRIT_CHANGE_COMMIT_MESSAGE
352               node-parameters: true
353               kill-phase-on: NEVER
354               abort-all-job: true
355               git-revision: false
356
357 # Baremetal Deploy and Test
358 - job-template:
359     name: 'apex-{scenario}-baremetal-{scenario_stream}'
360
361     project-type: 'multijob'
362
363     disabled: false
364
365     scm:
366       - git-scm
367
368     parameters:
369       - '{project}-defaults'
370       - '{project}-baremetal-{scenario_stream}-defaults'
371       - project-parameter:
372           project: '{project}'
373           branch: '{branch}'
374       - apex-parameter:
375           gs-pathname: '{gs-pathname}'
376       - string:
377           name: DEPLOY_SCENARIO
378           default: '{scenario}'
379           description: "Scenario to deploy with."
380
381     properties:
382       - logrotate-default
383       - build-blocker:
384           use-build-blocker: true
385           blocking-level: 'NODE'
386           blocking-jobs:
387             - 'apex-verify.*'
388             - 'apex-runner.*'
389             - 'apex-.*-promote.*'
390             - 'apex-run.*'
391             - 'apex-.+-baremetal-.+'
392       - throttle:
393           max-per-node: 1
394           max-total: 10
395           option: 'project'
396
397     builders:
398       - description-setter:
399           description: "Deployed on $NODE_NAME - Scenario: $DEPLOY_SCENARIO"
400       - multijob:
401           name: 'Baremetal Deploy'
402           condition: SUCCESSFUL
403           execution-type: SEQUENTIALLY
404           projects:
405             - name: 'apex-deploy-baremetal-{scenario_stream}'
406               node-parameters: true
407               current-parameters: true
408               predefined-parameters: |
409                 OPNFV_CLEAN=yes
410                 GERRIT_BRANCH=$GERRIT_BRANCH
411                 GERRIT_REFSPEC=
412                 DEPLOY_SCENARIO=$DEPLOY_SCENARIO
413               kill-phase-on: NEVER
414               abort-all-job: true
415               git-revision: false
416             - name: 'apex-fetch-logs-{scenario_stream}'
417               current-parameters: true
418               predefined-parameters: |
419                 GERRIT_BRANCH=$GERRIT_BRANCH
420                 GERRIT_REFSPEC=
421               node-parameters: true
422               kill-phase-on: NEVER
423               abort-all-job: true
424               git-revision: false
425       - shell: |
426           features=$(echo $DEPLOY_SCENARIO | sed -r -n 's/os-.+-(.+)-(noha|ha)/\1/p')
427           if [ "$features" == 'rocky' ]; then
428             functest_scenario=$(echo $DEPLOY_SCENARIO | sed -r -n 's/(os-.+?)-rocky-(noha|ha)/\1-nofeature-\2/p')
429             echo "DOCKER_TAG=hunter" > functest_scenario
430           elif [[ "$features" =~ 'rocky' ]]; then
431             functest_scenario=$(echo $DEPLOY_SCENARIO | sed -r -n 's/(os-.+?)-(.+)_rocky-(noha|ha)/\1-\2-\3/p')
432             echo "DOCKER_TAG=hunter" > functest_scenario
433           else
434             functest_scenario=$DEPLOY_SCENARIO
435           fi
436           echo "DEPLOY_SCENARIO=$functest_scenario" >> functest_scenario
437       - inject:
438           properties-file: functest_scenario
439           override-build-parameters: true
440       - multijob:
441           name: 'OPNFV Test Suite'
442           condition: ALWAYS
443           projects:
444             - name: 'apex-testsuite-{scenario}-baremetal-{scenario_stream}'
445               node-parameters: true
446               current-parameters: false
447               predefined-parameters: |
448                 DEPLOY_SCENARIO=$DEPLOY_SCENARIO
449                 DOCKER_TAG=$DOCKER_TAG
450               kill-phase-on: NEVER
451               abort-all-job: true
452               git-revision: false
453       - multijob:
454           name: apex-fetch-logs
455           projects:
456             - name: 'apex-fetch-logs-{scenario_stream}'
457               current-parameters: true
458               predefined-parameters: |
459                 GERRIT_BRANCH=$GERRIT_BRANCH
460                 GERRIT_REFSPEC=
461               node-parameters: true
462               kill-phase-on: NEVER
463               abort-all-job: true
464               git-revision: false
465     publishers:
466       - groovy-postbuild:
467           script:
468             !include-raw-escape: ./update-build-result.groovy
469
470 # Baremetal test job
471 - job-template:
472     name: 'apex-testsuite-{scenario}-baremetal-{scenario_stream}'
473
474     project-type: 'multijob'
475
476     disabled: false
477
478     parameters:
479       - '{project}-defaults'
480       - '{project}-baremetal-{scenario_stream}-defaults'
481       - project-parameter:
482           project: '{project}'
483           branch: '{branch}'
484       - apex-parameter:
485           gs-pathname: '{gs-pathname}'
486       - string:
487           name: DEPLOY_SCENARIO
488           default: '{scenario}'
489           description: "Scenario to deploy with."
490
491     properties:
492       - logrotate-default
493       - build-blocker:
494           use-build-blocker: true
495           blocking-level: 'NODE'
496           blocking-jobs:
497             - 'apex-verify.*'
498             - 'apex-runner.*'
499             - 'apex-run.*'
500             - 'apex-testsuite-.+-baremetal-.+'
501       - throttle:
502           max-per-node: 1
503           max-total: 10
504           option: 'project'
505
506     builders:
507       - description-setter:
508           description: "Testing on $NODE_NAME - Scenario: $DEPLOY_SCENARIO"
509       - multijob:
510           name: Functest
511           condition: ALWAYS
512           projects:
513             - name: 'functest-apex-baremetal-daily-{scenario_stream}'
514               node-parameters: true
515               current-parameters: false
516               predefined-parameters:
517                 DEPLOY_SCENARIO=$DEPLOY_SCENARIO
518               kill-phase-on: NEVER
519               abort-all-job: false
520               git-revision: false
521       - multijob:
522           name: Yardstick
523           condition: ALWAYS
524           projects:
525             - name: 'yardstick-apex-baremetal-daily-{scenario_stream}'
526               node-parameters: true
527               current-parameters: false
528               predefined-parameters:
529                 DEPLOY_SCENARIO=$DEPLOY_SCENARIO
530               kill-phase-on: NEVER
531               abort-all-job: false
532               git-revision: false
533       - multijob:
534           name: Dovetail-proposed_tests
535           condition: ALWAYS
536           projects:
537             - name: 'dovetail-apex-baremetal-default-mandatory-{scenario_stream}'
538               node-parameters: true
539               current-parameters: false
540               predefined-parameters:
541                 DEPLOY_SCENARIO=$DEPLOY_SCENARIO
542               kill-phase-on: NEVER
543               enable-condition: "def m = '$DEPLOY_SCENARIO' ==~ /os-(nosdn-nofeature|odl-bgpvpn)-ha/"
544               abort-all-job: false
545               git-revision: false
546       - multijob:
547           name: Dovetail-default
548           condition: ALWAYS
549           projects:
550             - name: 'dovetail-apex-baremetal-default-optional-{scenario_stream}'
551               node-parameters: true
552               current-parameters: false
553               predefined-parameters:
554                 DEPLOY_SCENARIO=$DEPLOY_SCENARIO
555               kill-phase-on: NEVER
556               enable-condition: "def m = '$DEPLOY_SCENARIO' ==~ /os-(nosdn-nofeature|odl-bgpvpn)-ha/"
557               abort-all-job: false
558               git-revision: false
559       - multijob:
560           name: StorPerf
561           condition: ALWAYS
562           projects:
563             - name: 'storperf-apex-baremetal-daily-{scenario_stream}'
564               node-parameters: true
565               current-parameters: false
566               predefined-parameters:
567                 DEPLOY_SCENARIO=$DEPLOY_SCENARIO
568               enable-condition: "def m = '$DEPLOY_SCENARIO' ==~ /os-nosdn-nofeature-ha/"
569               kill-phase-on: NEVER
570               abort-all-job: false
571               git-revision: false
572 # Build status is always success due conditional plugin prefetching
573 # build status before multijob phases execute
574 #        - conditional-step:
575 #            condition-kind: current-status
576 #            condition-worst: SUCCESS
577 #            condtion-best: SUCCESS
578 #            on-evaluation-failure: mark-unstable
579 #            steps:
580 #                - shell: 'echo "Tests Passed"'
581
582 - job-template:
583     name: 'apex-daily-{stream}'
584
585     # Job template for daily build
586     #
587     # Required Variables:
588     #     stream:    branch with - in place of / (eg. stable)
589     #     branch:    branch (eg. stable)
590     project-type: 'multijob'
591
592     disabled: '{obj:disable_daily}'
593
594     scm:
595       - git-scm
596
597     parameters:
598       - '{project}-defaults'
599       - '{project}-baremetal-{stream}-defaults'
600       - project-parameter:
601           project: '{project}'
602           branch: '{branch}'
603       - apex-parameter:
604           gs-pathname: '{gs-pathname}'
605
606     properties:
607       - logrotate-default
608       - build-blocker:
609           use-build-blocker: true
610           blocking-level: 'NODE'
611           blocking-jobs:
612             - 'apex-daily.*'
613
614     triggers:
615       - 'apex-{stream}'
616
617     builders:
618       - multijob:
619           name: build
620           condition: SUCCESSFUL
621           projects:
622             - name: 'apex-build-{stream}'
623               current-parameters: false
624               predefined-parameters: |
625                 GERRIT_BRANCH=$GERRIT_BRANCH
626                 GERRIT_REFSPEC=
627                 GERRIT_CHANGE_NUMBER=$GERRIT_CHANGE_NUMBER
628                 GERRIT_CHANGE_COMMIT_MESSAGE=$GERRIT_CHANGE_COMMIT_MESSAGE
629               node-parameters: true
630               kill-phase-on: FAILURE
631               abort-all-job: true
632               git-revision: true
633       - multijob:
634           name: 'Verify and upload ISO'
635           condition: SUCCESSFUL
636           projects:
637             - name: 'apex-verify-iso-{stream}'
638               current-parameters: false
639               predefined-parameters: |
640                 BUILD_DIRECTORY=$WORKSPACE/../apex-build-{stream}/.build
641                 GERRIT_BRANCH=$GERRIT_BRANCH
642                 GERRIT_REFSPEC=
643                 GERRIT_CHANGE_NUMBER=$GERRIT_CHANGE_NUMBER
644                 GERRIT_CHANGE_COMMIT_MESSAGE=$GERRIT_CHANGE_COMMIT_MESSAGE
645               node-parameters: true
646               kill-phase-on: FAILURE
647               abort-all-job: true
648               git-revision: true
649       - apex-builder-{stream}
650
651 # snapshot info fetch
652 - job-template:
653     name: 'apex-fetch-snap-info'
654
655     disabled: false
656
657     parameters:
658       - '{project}-defaults'
659
660     builders:
661       - shell:
662           !include-raw-escape: ./apex-fetch-snap-info.sh
663
664 # snapshot create
665 - job-template:
666     name: 'apex-create-snapshot'
667
668     disabled: false
669
670     parameters:
671       - '{project}-defaults'
672
673     builders:
674       - shell:
675           !include-raw-escape: ./apex-snapshot-create.sh
676
677 # snapshot upload
678 - job-template:
679     name: 'apex-upload-snapshot'
680
681     disabled: false
682
683     parameters:
684       - '{project}-defaults'
685
686     builders:
687       - inject:
688           properties-content: ARTIFACT_TYPE=snapshot
689       - 'apex-upload-artifact'
690
691 # CSIT promote
692 - job-template:
693     name: 'apex-csit-promote-daily-{stream}-os-{os_version}-{topology}'
694
695     # Job template for promoting CSIT Snapshots
696     #
697     # Required Variables:
698     #     stream:    branch with - in place of / (eg. stable)
699     #     branch:    branch (eg. stable)
700     node: '{virtual-slave}'
701     project-type: 'multijob'
702     disabled: '{disable_promote}'
703
704     scm:
705       - git-scm
706
707     parameters:
708       - project-parameter:
709           project: '{project}'
710           branch: '{branch}'
711       - apex-parameter:
712           gs-pathname: '{gs-pathname}'
713       - string:
714           name: ARTIFACT_VERSION
715           default: dev
716           description: "Used for overriding the ARTIFACT_VERSION"
717       - string:
718           name: PROMOTE
719           default: 'True'
720           description: "Used for overriding the PROMOTE"
721       - string:
722           name: GS_URL
723           default: 'artifacts.opnfv.org/apex/{os_version}/{topology}'
724           description: "User for overriding GS_URL from apex params"
725       - string:
726           name: OS_VERSION
727           default: '{os_version}'
728           description: OpenStack version short name
729       - string:
730           name: ODL_BRANCH
731           default: '{odl_branch}'
732           description: ODL branch being used
733       - string:
734           name: FORCE_PROMOTE
735           default: 'False'
736           description: "Used to force promotion and skip CSIT"
737     properties:
738       - build-blocker:
739           use-build-blocker: true
740           blocking-level: 'NODE'
741           blocking-jobs:
742             - 'apex-verify.*'
743             - 'apex-runner.*'
744             - 'apex-daily.*'
745             - 'apex-csit-promote.*'
746             - 'odl-netvirt.*'
747       - throttle:
748           max-per-node: 1
749           max-total: 10
750           option: 'project'
751
752     triggers:
753       - '{stream}-{os_version}'
754
755     builders:
756       - multijob:
757           name: apex-virtual-deploy
758           condition: SUCCESSFUL
759           projects:
760             - name: 'apex-deploy-virtual-{stream}'
761               current-parameters: true
762               predefined-parameters: |
763                 DEPLOY_SCENARIO=os-odl-{os_scenario}-{topology}
764                 OPNFV_CLEAN=yes
765                 GERRIT_BRANCH=$GERRIT_BRANCH
766                 GERRIT_REFSPEC=$GERRIT_REFSPEC
767                 GERRIT_CHANGE_NUMBER=$GERRIT_CHANGE_NUMBER
768                 GERRIT_CHANGE_COMMIT_MESSAGE=$GERRIT_CHANGE_COMMIT_MESSAGE
769               node-parameters: true
770               kill-phase-on: FAILURE
771               abort-all-job: true
772               git-revision: true
773       - multijob:
774           name: fetch snapshot info
775           condition: SUCCESSFUL
776           projects:
777             - name: 'apex-fetch-snap-info'
778               current-parameters: true
779               node-parameters: true
780               kill-phase-on: FAILURE
781               abort-all-job: true
782               git-revision: false
783       - multijob:
784           name: csit
785           condition: SUCCESSFUL
786           execution-type: SEQUENTIALLY
787           projects:
788             - name: cperf-apex-csit-master
789               predefined-parameters: |
790                 ODL_BRANCH=$ODL_BRANCH
791                 RC_FILE_PATH=/tmp/csit/overcloudrc
792                 NODE_FILE_PATH=/tmp/csit/node.yaml
793                 SSH_KEY_PATH=/tmp/csit/id_rsa
794                 ODL_CONTAINERIZED=true
795                 OS_VERSION=$OS_VERSION
796                 SKIP_CSIT=$FORCE_PROMOTE
797               node-parameters: true
798               kill-phase-on: NEVER
799               abort-all-job: false
800             - name: cperf-upload-logs-csit
801               predefined-parameters: |
802                 ODL_BRANCH=$ODL_BRANCH
803                 OS_VERSION=$OS_VERSION
804               node-parameters: true
805               kill-phase-on: FAILURE
806               abort-all-job: false
807             - name: 'apex-fetch-logs-{stream}'
808               current-parameters: false
809               predefined-parameters: |
810                 GERRIT_BRANCH=$GERRIT_BRANCH
811                 GERRIT_REFSPEC=$GERRIT_REFSPEC
812                 GERRIT_CHANGE_NUMBER=$GERRIT_CHANGE_NUMBER
813                 GERRIT_CHANGE_COMMIT_MESSAGE=$GERRIT_CHANGE_COMMIT_MESSAGE
814               node-parameters: true
815               kill-phase-on: NEVER
816               abort-all-job: true
817               git-revision: false
818       - multijob:
819           name: create snapshot
820           condition: SUCCESSFUL
821           projects:
822             - name: 'apex-create-snapshot'
823               current-parameters: true
824               predefined-parameters: |
825                 SNAP_TYPE=csit
826               node-parameters: true
827               kill-phase-on: FAILURE
828               abort-all-job: true
829               git-revision: false
830       - multijob:
831           name: upload snapshot
832           condition: SUCCESSFUL
833           projects:
834             - name: 'apex-upload-snapshot'
835               current-parameters: true
836               predefined-parameters: |
837                 SNAP_TYPE=csit
838               node-parameters: true
839               kill-phase-on: FAILURE
840               abort-all-job: true
841               git-revision: false
842
843 # FDIO promote
844 - job-template:
845     name: 'apex-fdio-promote-daily-{stream}'
846
847     # Job template for promoting CSIT Snapshots
848     #
849     # Required Variables:
850     #     stream:    branch with - in place of / (eg. stable)
851     #     branch:    branch (eg. stable)
852     node: '{virtual-slave}'
853     project-type: 'multijob'
854     disabled: false
855
856     scm:
857       - git-scm
858
859     parameters:
860       - project-parameter:
861           project: '{project}'
862           branch: '{branch}'
863       - apex-parameter:
864           gs-pathname: '{gs-pathname}'
865
866     properties:
867       - build-blocker:
868           use-build-blocker: true
869           blocking-level: 'NODE'
870           blocking-jobs:
871             - 'apex-verify.*'
872             - 'apex-deploy.*'
873             - 'apex-runner.*'
874             - 'apex-daily.*'
875
876     builders:
877       - multijob:
878           name: build
879           condition: SUCCESSFUL
880           projects:
881             - name: 'apex-build-{stream}'
882               current-parameters: false
883               predefined-parameters: |
884                 GERRIT_BRANCH=$GERRIT_BRANCH
885                 GERRIT_REFSPEC=$GERRIT_REFSPEC
886                 GERRIT_CHANGE_NUMBER=$GERRIT_CHANGE_NUMBER
887                 GERRIT_CHANGE_COMMIT_MESSAGE=$GERRIT_CHANGE_COMMIT_MESSAGE
888               node-parameters: false
889               kill-phase-on: FAILURE
890               abort-all-job: true
891               git-revision: true
892       - multijob:
893           name: deploy-virtual
894           condition: SUCCESSFUL
895           projects:
896             - name: 'apex-deploy-virtual-{stream}'
897               current-parameters: false
898               predefined-parameters: |
899                 DEPLOY_SCENARIO=os-odl_netvirt-fdio-noha
900                 OPNFV_CLEAN=yes
901                 GERRIT_BRANCH=$GERRIT_BRANCH
902                 GERRIT_REFSPEC=$GERRIT_REFSPEC
903                 GERRIT_CHANGE_NUMBER=$GERRIT_CHANGE_NUMBER
904                 GERRIT_CHANGE_COMMIT_MESSAGE=$GERRIT_CHANGE_COMMIT_MESSAGE
905                 PROMOTE=True
906               node-parameters: true
907               kill-phase-on: FAILURE
908               abort-all-job: true
909               git-revision: false
910       - multijob:
911           name: create snapshot
912           condition: SUCCESSFUL
913           projects:
914             - name: 'apex-create-snapshot'
915               current-parameters: false
916               predefined-parameters: |
917                 SNAP_TYPE=fdio
918               node-parameters: true
919               kill-phase-on: FAILURE
920               abort-all-job: true
921               git-revision: false
922       - multijob:
923           name: upload snapshot
924           condition: SUCCESSFUL
925           projects:
926             - name: 'apex-upload-snapshot'
927               current-parameters: false
928               predefined-parameters: |
929                 SNAP_TYPE=fdio
930               node-parameters: true
931               kill-phase-on: FAILURE
932               abort-all-job: true
933               git-revision: false
934
935 # Flex job
936 - job-template:
937     name: 'apex-flex-daily-os-nosdn-nofeature-ha-{stream}'
938
939     project-type: 'multijob'
940
941     disabled: false
942
943     node: 'flex-pod2'
944
945     scm:
946       - git-scm
947
948     triggers:
949       - 'apex-{stream}'
950
951     parameters:
952       - '{project}-defaults'
953       - project-parameter:
954           project: '{project}'
955           branch: '{branch}'
956       - apex-parameter:
957           gs-pathname: '{gs-pathname}'
958       - string:
959           name: DEPLOY_SCENARIO
960           default: 'os-nosdn-nofeature-ha'
961           description: "Scenario to deploy with."
962       - string:
963           name: GIT_BASE
964           default: https://gerrit.opnfv.org/gerrit/$PROJECT
965           description: 'Git URL to use on this Jenkins Slave'
966       - string:
967           name: SSH_KEY
968           default: /root/.ssh/id_rsa
969           description: 'SSH key to use for Apex'
970
971     properties:
972       - logrotate-default
973       - build-blocker:
974           use-build-blocker: true
975           blocking-level: 'NODE'
976           blocking-jobs:
977             - 'apex-verify.*'
978             - 'apex-runner.*'
979             - 'apex-.*-promote.*'
980             - 'apex-run.*'
981             - 'apex-.+-baremetal-.+'
982       - throttle:
983           max-per-node: 1
984           max-total: 10
985           option: 'project'
986
987     builders:
988       - description-setter:
989           description: "Deployed on $NODE_NAME - Scenario: $DEPLOY_SCENARIO"
990       - multijob:
991           name: 'Baremetal Deploy'
992           condition: SUCCESSFUL
993           projects:
994             - name: 'apex-deploy-baremetal-{stream}'
995               node-parameters: true
996               current-parameters: true
997               predefined-parameters: |
998                 OPNFV_CLEAN=yes
999                 GERRIT_BRANCH=$GERRIT_BRANCH
1000                 GERRIT_REFSPEC=
1001                 DEPLOY_SCENARIO=$DEPLOY_SCENARIO
1002               kill-phase-on: FAILURE
1003               abort-all-job: true
1004               git-revision: false
1005       - multijob:
1006           name: Yardstick
1007           condition: ALWAYS
1008           projects:
1009             - name: 'yardstick-apex-baremetal-daily-{stream}'
1010               node-parameters: true
1011               current-parameters: false
1012               predefined-parameters:
1013                 DEPLOY_SCENARIO=$DEPLOY_SCENARIO
1014               kill-phase-on: NEVER
1015               abort-all-job: false
1016               git-revision: false
1017
1018 # Dovetail Danube test job
1019 - job-template:
1020     name: 'apex-dovetail-daily-os-nosdn-nofeature-ha-baremetal-danube'
1021
1022     project-type: 'multijob'
1023
1024     node: 'huawei-pod4'
1025
1026     disabled: false
1027
1028     parameters:
1029       - '{project}-defaults'
1030       - project-parameter:
1031           project: '{project}'
1032           branch: 'stable/danube'
1033       - apex-parameter:
1034           gs-pathname: '/danube'
1035       - string:
1036           name: DEPLOY_SCENARIO
1037           default: 'os-nosdn-nofeature-ha'
1038           description: "Scenario to deploy with."
1039
1040     properties:
1041       - logrotate-default
1042       - build-blocker:
1043           use-build-blocker: true
1044           blocking-level: 'NODE'
1045           blocking-jobs:
1046             - 'apex-verify.*'
1047             - 'apex-runner.*'
1048             - 'apex-.*-promote.*'
1049             - 'apex-run.*'
1050
1051     triggers:
1052       - timed: ''  # '0 1 * * *'
1053
1054     builders:
1055       - description-setter:
1056           description: "Testing on $NODE_NAME - Scenario: $DEPLOY_SCENARIO"
1057       - multijob:
1058           name: 'Baremetal Deploy'
1059           condition: SUCCESSFUL
1060           projects:
1061             - name: 'apex-deploy-baremetal-danube'
1062               node-parameters: true
1063               current-parameters: true
1064               predefined-parameters: |
1065                 OPNFV_CLEAN=yes
1066                 GERRIT_BRANCH=$GERRIT_BRANCH
1067                 GERRIT_REFSPEC=
1068                 DEPLOY_SCENARIO=$DEPLOY_SCENARIO
1069               kill-phase-on: FAILURE
1070               abort-all-job: true
1071               git-revision: false
1072       - multijob:
1073           name: Dovetail
1074           condition: ALWAYS
1075           projects:
1076             - name: 'dovetail-apex-baremetal-proposed_tests-danube'
1077               node-parameters: true
1078               current-parameters: false
1079               predefined-parameters:
1080                 DEPLOY_SCENARIO=$DEPLOY_SCENARIO
1081               kill-phase-on: NEVER
1082               abort-all-job: false
1083               git-revision: false
1084
1085 ########################
1086 # parameter macros
1087 ########################
1088 - parameter:
1089     name: apex-parameter
1090     parameters:
1091       - string:
1092           name: ARTIFACT_NAME
1093           default: 'latest'
1094           description: "RPM Artifact name that will be appended to GS_URL to deploy a specific artifact"
1095       - string:
1096           name: ARTIFACT_VERSION
1097           default: 'daily'
1098           description: "Artifact version type"
1099       - string:
1100           name: BUILD_DIRECTORY
1101           default: $WORKSPACE/.build
1102           description: "Directory where the build artifact will be located upon the completion of the build."
1103       - string:
1104           name: CACHE_DIRECTORY
1105           default: $HOME/opnfv/apex-cache{gs-pathname}
1106           description: "Directory where the cache to be used during the build is located."
1107       # yamllint disable rule:line-length
1108       - string:
1109           name: GIT_BASE
1110           default: https://gerrit.opnfv.org/gerrit/$PROJECT
1111           description: "Used for overriding the GIT URL coming from Global Jenkins configuration in case if the stuff is done on none-LF HW."
1112       # yamllint enable rule:line-length
1113       - string:
1114           name: GS_PATHNAME
1115           default: '{gs-pathname}'
1116           description: "Version directory where opnfv artifacts are stored in gs repository"
1117       - string:
1118           name: GS_URL
1119           default: $GS_BASE{gs-pathname}
1120           description: "URL to Google Storage."
1121       - string:
1122           name: PROMOTE
1123           default: 'False'
1124           description: "Flag to know if we should promote/upload snapshot artifacts."
1125
1126 ########################
1127 # builder macros
1128 ########################
1129 {% for stream in scenarios %}
1130 # {{ stream }} Builder
1131 - builder:
1132     name: apex-builder-{{ stream }}
1133     builders:
1134       - multijob:
1135           name: Baremetal Deploy and Test Phase
1136           condition: SUCCESSFUL
1137           projects:
1138 {%- for scenario in scenarios[stream] %}
1139             - name: 'apex-{{ scenario }}-baremetal-{{ stream }}'
1140               node-parameters: false
1141               current-parameters: false
1142               predefined-parameters: |
1143                 OPNFV_CLEAN=yes
1144               kill-phase-on: NEVER
1145               abort-all-job: true
1146               git-revision: false
1147 {%- endfor %}
1148 {% endfor -%}
1149
1150 - builder:
1151     name: 'apex-upload-artifact'
1152     builders:
1153       - shell:
1154           !include-raw: ./apex-upload-artifact.sh
1155
1156 - builder:
1157     name: 'apex-download-artifact'
1158     builders:
1159       - shell:
1160           !include-raw: ./apex-download-artifact.sh
1161
1162 - builder:
1163     name: 'apex-deploy'
1164     builders:
1165       - shell:
1166           !include-raw: ./apex-deploy.sh
1167
1168 - builder:
1169     name: 'apex-fetch-logs'
1170     builders:
1171       - shell:
1172           !include-raw: ./apex-fetch-logs.sh
1173
1174 #######################
1175 # trigger macros
1176 # timed is in format: 'min hour daymonth month dayweek'
1177 ########################
1178 - trigger:
1179     name: 'apex-master'
1180     triggers:
1181       - timed: '0 0 1-31/2 * *'
1182
1183 - trigger:
1184     name: 'apex-gambia'
1185     triggers:
1186       - timed: '0 4 2-30/2 * *'
1187
1188 - trigger:
1189     name: 'apex-fraser'
1190     triggers:
1191       - timed: '0 0 2-30/2 * *'
1192
1193 - trigger:
1194     name: 'apex-euphrates'
1195     triggers:
1196       - timed: '0 0 2-30/2 * *'
1197
1198 - trigger:
1199     name: 'apex-danube'
1200     triggers:
1201       - timed: '0 3 1 1 7'
1202
1203 - trigger:
1204     name: 'master-master'
1205     triggers:
1206       - timed: '0 5 * * *'
1207
1208 - trigger:
1209     name: 'master-rocky'
1210     triggers:
1211       - timed: '0 5 * * *'
1212
1213 - trigger:
1214     name: 'master-queens'
1215     triggers:
1216       - timed: ''
1217
1218 - trigger:
1219     name: 'gambia-master'
1220     triggers:
1221       - timed: ''
1222
1223 - trigger:
1224     name: 'gambia-rocky'
1225     triggers:
1226       - timed: ''
1227
1228 - trigger:
1229     name: 'gambia-queens'
1230     triggers:
1231       - timed: '0 5 * * *'
1232
1233 - trigger:
1234     name: 'fraser-master'
1235     triggers:
1236       - timed: ''
1237
1238 - trigger:
1239     name: 'fraser-rocky'
1240     triggers:
1241       - timed: ''
1242
1243 - trigger:
1244     name: 'fraser-queens'
1245     triggers:
1246       - timed: ''
1247
1248 - trigger:
1249     name: 'euphrates-master'
1250     triggers:
1251       - timed: ''
1252
1253 - trigger:
1254     name: 'euphrates-rocky'
1255     triggers:
1256       - timed: ''
1257
1258 - trigger:
1259     name: 'euphrates-queens'
1260     triggers:
1261       - timed: ''
1262
1263 - trigger:
1264     name: 'danube-master'
1265     triggers:
1266       - timed: ''
1267
1268 - trigger:
1269     name: 'danube-rocky'
1270     triggers:
1271       - timed: ''
1272
1273 - trigger:
1274     name: 'danube-queens'
1275     triggers:
1276       - timed: ''