Merge "Set image and flavor env variables functest for ovs|fdio"
[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: 'queens'
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           block-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           block-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           block-level: 'NODE'
290           blocking-jobs:
291             - 'apex-runner.*'
292             - 'apex-run.*'
293             - 'apex-virtual-.*'
294             - 'apex-verify-gate-.*'
295             - 'odl-netvirt.*'
296       - throttle:
297           max-per-node: 1
298           max-total: 10
299           option: 'project'
300
301     builders:
302       - description-setter:
303           description: "Deployed on $NODE_NAME - Scenario: $DEPLOY_SCENARIO"
304       - multijob:
305           name: deploy-virtual
306           condition: SUCCESSFUL
307           projects:
308             - name: 'apex-deploy-virtual-{stream}'
309               current-parameters: false
310               predefined-parameters: |
311                 ARTIFACT_VERSION=$ARTIFACT_VERSION
312                 DEPLOY_SCENARIO=$DEPLOY_SCENARIO
313                 OPNFV_CLEAN=yes
314                 GERRIT_BRANCH=$GERRIT_BRANCH
315                 GERRIT_REFSPEC=$GERRIT_REFSPEC
316                 GERRIT_CHANGE_NUMBER=$GERRIT_CHANGE_NUMBER
317                 GERRIT_CHANGE_COMMIT_MESSAGE=$GERRIT_CHANGE_COMMIT_MESSAGE
318                 PROMOTE=$PROMOTE
319               node-parameters: true
320               kill-phase-on: FAILURE
321               abort-all-job: true
322               git-revision: true
323       - shell: |
324           if echo $DEPLOY_SCENARIO | grep queens &> /dev/null; then
325           echo 'REPO=opnfv' > functest_repo
326           else
327           echo 'REPO=ollivier' > functest_repo
328           fi
329       - inject:
330           properties-file: functest_repo
331       - multijob:
332           name: functest-smoke
333           condition: ALWAYS
334           projects:
335             - name: 'functest-apex-virtual-suite-{stream}'
336               current-parameters: false
337               predefined-parameters: |
338                 DEPLOY_SCENARIO=$DEPLOY_SCENARIO
339                 FUNCTEST_MODE=$FUNCTEST_MODE
340                 FUNCTEST_SUITE_NAME=$FUNCTEST_SUITE_NAME
341                 REPO=$REPO
342                 GERRIT_BRANCH=$GERRIT_BRANCH
343                 GERRIT_REFSPEC=$GERRIT_REFSPEC
344                 GERRIT_CHANGE_NUMBER=$GERRIT_CHANGE_NUMBER
345                 GERRIT_CHANGE_COMMIT_MESSAGE=$GERRIT_CHANGE_COMMIT_MESSAGE
346               node-parameters: true
347               kill-phase-on: NEVER
348               abort-all-job: true
349               git-revision: false
350       - multijob:
351           name: apex-fetch-logs
352           projects:
353             - name: 'apex-fetch-logs-{stream}'
354               current-parameters: false
355               predefined-parameters: |
356                 GERRIT_BRANCH=$GERRIT_BRANCH
357                 GERRIT_REFSPEC=$GERRIT_REFSPEC
358                 GERRIT_CHANGE_NUMBER=$GERRIT_CHANGE_NUMBER
359                 GERRIT_CHANGE_COMMIT_MESSAGE=$GERRIT_CHANGE_COMMIT_MESSAGE
360               node-parameters: true
361               kill-phase-on: NEVER
362               abort-all-job: true
363               git-revision: false
364
365 # Baremetal Deploy and Test
366 - job-template:
367     name: 'apex-{scenario}-baremetal-{scenario_stream}'
368
369     project-type: 'multijob'
370
371     disabled: false
372
373     scm:
374       - git-scm
375
376     parameters:
377       - '{project}-defaults'
378       - '{project}-baremetal-{scenario_stream}-defaults'
379       - project-parameter:
380           project: '{project}'
381           branch: '{branch}'
382       - apex-parameter:
383           gs-pathname: '{gs-pathname}'
384       - string:
385           name: DEPLOY_SCENARIO
386           default: '{scenario}'
387           description: "Scenario to deploy with."
388
389     properties:
390       - logrotate-default
391       - build-blocker:
392           use-build-blocker: true
393           block-level: 'NODE'
394           blocking-jobs:
395             - 'apex-verify.*'
396             - 'apex-runner.*'
397             - 'apex-.*-promote.*'
398             - 'apex-run.*'
399             - 'apex-.+-baremetal-.+'
400       - throttle:
401           max-per-node: 1
402           max-total: 10
403           option: 'project'
404
405     builders:
406       - description-setter:
407           description: "Deployed on $NODE_NAME - Scenario: $DEPLOY_SCENARIO"
408       - multijob:
409           name: 'Baremetal Deploy'
410           condition: SUCCESSFUL
411           execution-type: SEQUENTIALLY
412           projects:
413             - name: 'apex-deploy-baremetal-{scenario_stream}'
414               node-parameters: true
415               current-parameters: true
416               predefined-parameters: |
417                 OPNFV_CLEAN=yes
418                 GERRIT_BRANCH=$GERRIT_BRANCH
419                 GERRIT_REFSPEC=
420                 DEPLOY_SCENARIO=$DEPLOY_SCENARIO
421               kill-phase-on: NEVER
422               abort-all-job: true
423               git-revision: false
424             - name: 'apex-fetch-logs-{scenario_stream}'
425               current-parameters: true
426               predefined-parameters: |
427                 GERRIT_BRANCH=$GERRIT_BRANCH
428                 GERRIT_REFSPEC=
429               node-parameters: true
430               kill-phase-on: NEVER
431               abort-all-job: true
432               git-revision: false
433       - shell: |
434           if echo $DEPLOY_SCENARIO | grep queens &> /dev/null; then
435             echo 'REPO=opnfv' > functest_properties
436           else
437             echo 'REPO=ollivier' > functest_properties
438           fi
439           features=$(echo $DEPLOY_SCENARIO | sed -r -n 's/os-.+-(.+)-(noha|ha)/\1/p')
440           if [ "$features" == 'queens' ]; then
441             functest_scenario=$(echo $DEPLOY_SCENARIO | sed -r -n 's/(os-.+?)-queens-(noha|ha)/\1-nofeature-\2/p')
442           elif [[ "$features" =~ 'queens' ]]; then
443             functest_scenario=$(echo $DEPLOY_SCENARIO | sed -r -n 's/(os-.+?)-(.+)_queens-(noha|ha)/\1-\2-\3/p')
444           else
445             functest_scenario=$DEPLOY_SCENARIO
446           fi
447           echo "DEPLOY_SCENARIO=$functest_scenario" >> functest_properties
448       - inject:
449           properties-file: functest_properties
450           override-build-parameters: true
451       - multijob:
452           name: 'OPNFV Test Suite'
453           condition: ALWAYS
454           projects:
455             - name: 'apex-testsuite-{scenario}-baremetal-{scenario_stream}'
456               node-parameters: true
457               current-parameters: false
458               predefined-parameters:
459                 DEPLOY_SCENARIO=$DEPLOY_SCENARIO
460               kill-phase-on: NEVER
461               abort-all-job: true
462               git-revision: false
463       - multijob:
464           name: apex-fetch-logs
465           projects:
466             - name: 'apex-fetch-logs-{scenario_stream}'
467               current-parameters: true
468               predefined-parameters: |
469                 GERRIT_BRANCH=$GERRIT_BRANCH
470                 GERRIT_REFSPEC=
471               node-parameters: true
472               kill-phase-on: NEVER
473               abort-all-job: true
474               git-revision: false
475     publishers:
476       - groovy-postbuild:
477           script:
478             !include-raw-escape: ./update-build-result.groovy
479
480 # Baremetal test job
481 - job-template:
482     name: 'apex-testsuite-{scenario}-baremetal-{scenario_stream}'
483
484     project-type: 'multijob'
485
486     disabled: false
487
488     parameters:
489       - '{project}-defaults'
490       - '{project}-baremetal-{scenario_stream}-defaults'
491       - project-parameter:
492           project: '{project}'
493           branch: '{branch}'
494       - apex-parameter:
495           gs-pathname: '{gs-pathname}'
496       - string:
497           name: DEPLOY_SCENARIO
498           default: '{scenario}'
499           description: "Scenario to deploy with."
500
501     properties:
502       - logrotate-default
503       - build-blocker:
504           use-build-blocker: true
505           block-level: 'NODE'
506           blocking-jobs:
507             - 'apex-verify.*'
508             - 'apex-runner.*'
509             - 'apex-run.*'
510             - 'apex-testsuite-.+-baremetal-.+'
511       - throttle:
512           max-per-node: 1
513           max-total: 10
514           option: 'project'
515
516     builders:
517       - description-setter:
518           description: "Testing on $NODE_NAME - Scenario: $DEPLOY_SCENARIO"
519       - multijob:
520           name: Functest
521           condition: ALWAYS
522           projects:
523             - name: 'functest-apex-baremetal-daily-{scenario_stream}'
524               node-parameters: true
525               current-parameters: false
526               predefined-parameters:
527                 DEPLOY_SCENARIO=$DEPLOY_SCENARIO
528               kill-phase-on: NEVER
529               abort-all-job: false
530               git-revision: false
531       - multijob:
532           name: Yardstick
533           condition: ALWAYS
534           projects:
535             - name: 'yardstick-apex-baremetal-daily-{scenario_stream}'
536               node-parameters: true
537               current-parameters: false
538               predefined-parameters:
539                 DEPLOY_SCENARIO=$DEPLOY_SCENARIO
540               kill-phase-on: NEVER
541               abort-all-job: false
542               git-revision: false
543       - multijob:
544           name: Dovetail-proposed_tests
545           condition: ALWAYS
546           projects:
547             - name: 'dovetail-apex-baremetal-default-mandatory-{scenario_stream}'
548               node-parameters: true
549               current-parameters: false
550               predefined-parameters:
551                 DEPLOY_SCENARIO=$DEPLOY_SCENARIO
552               kill-phase-on: NEVER
553               enable-condition: "def m = '$DEPLOY_SCENARIO' ==~ /os-(nosdn-nofeature|odl-bgpvpn)-ha/"
554               abort-all-job: false
555               git-revision: false
556       - multijob:
557           name: Dovetail-default
558           condition: ALWAYS
559           projects:
560             - name: 'dovetail-apex-baremetal-default-optional-{scenario_stream}'
561               node-parameters: true
562               current-parameters: false
563               predefined-parameters:
564                 DEPLOY_SCENARIO=$DEPLOY_SCENARIO
565               kill-phase-on: NEVER
566               enable-condition: "def m = '$DEPLOY_SCENARIO' ==~ /os-(nosdn-nofeature|odl-bgpvpn)-ha/"
567               abort-all-job: false
568               git-revision: false
569       - multijob:
570           name: StorPerf
571           condition: ALWAYS
572           projects:
573             - name: 'storperf-apex-baremetal-daily-{scenario_stream}'
574               node-parameters: true
575               current-parameters: false
576               predefined-parameters:
577                 DEPLOY_SCENARIO=$DEPLOY_SCENARIO
578               enable-condition: "def m = '$DEPLOY_SCENARIO' ==~ /os-nosdn-nofeature-ha/"
579               kill-phase-on: NEVER
580               abort-all-job: false
581               git-revision: false
582 # Build status is always success due conditional plugin prefetching
583 # build status before multijob phases execute
584 #        - conditional-step:
585 #            condition-kind: current-status
586 #            condition-worst: SUCCESS
587 #            condtion-best: SUCCESS
588 #            on-evaluation-failure: mark-unstable
589 #            steps:
590 #                - shell: 'echo "Tests Passed"'
591
592 - job-template:
593     name: 'apex-daily-{stream}'
594
595     # Job template for daily build
596     #
597     # Required Variables:
598     #     stream:    branch with - in place of / (eg. stable)
599     #     branch:    branch (eg. stable)
600     project-type: 'multijob'
601
602     disabled: '{obj:disable_daily}'
603
604     scm:
605       - git-scm
606
607     parameters:
608       - '{project}-defaults'
609       - '{project}-baremetal-{stream}-defaults'
610       - project-parameter:
611           project: '{project}'
612           branch: '{branch}'
613       - apex-parameter:
614           gs-pathname: '{gs-pathname}'
615
616     properties:
617       - logrotate-default
618       - build-blocker:
619           use-build-blocker: true
620           block-level: 'NODE'
621           blocking-jobs:
622             - 'apex-daily.*'
623
624     triggers:
625       - 'apex-{stream}'
626
627     builders:
628       - multijob:
629           name: build
630           condition: SUCCESSFUL
631           projects:
632             - name: 'apex-build-{stream}'
633               current-parameters: false
634               predefined-parameters: |
635                 GERRIT_BRANCH=$GERRIT_BRANCH
636                 GERRIT_REFSPEC=
637                 GERRIT_CHANGE_NUMBER=$GERRIT_CHANGE_NUMBER
638                 GERRIT_CHANGE_COMMIT_MESSAGE=$GERRIT_CHANGE_COMMIT_MESSAGE
639               node-parameters: true
640               kill-phase-on: FAILURE
641               abort-all-job: true
642               git-revision: true
643       - multijob:
644           name: 'Verify and upload ISO'
645           condition: SUCCESSFUL
646           projects:
647             - name: 'apex-verify-iso-{stream}'
648               current-parameters: false
649               predefined-parameters: |
650                 BUILD_DIRECTORY=$WORKSPACE/../apex-build-{stream}/.build
651                 GERRIT_BRANCH=$GERRIT_BRANCH
652                 GERRIT_REFSPEC=
653                 GERRIT_CHANGE_NUMBER=$GERRIT_CHANGE_NUMBER
654                 GERRIT_CHANGE_COMMIT_MESSAGE=$GERRIT_CHANGE_COMMIT_MESSAGE
655               node-parameters: true
656               kill-phase-on: FAILURE
657               abort-all-job: true
658               git-revision: true
659       - apex-builder-{stream}
660
661 # snapshot info fetch
662 - job-template:
663     name: 'apex-fetch-snap-info'
664
665     disabled: false
666
667     parameters:
668       - '{project}-defaults'
669
670     builders:
671       - shell:
672           !include-raw-escape: ./apex-fetch-snap-info.sh
673
674 # snapshot create
675 - job-template:
676     name: 'apex-create-snapshot'
677
678     disabled: false
679
680     parameters:
681       - '{project}-defaults'
682
683     builders:
684       - shell:
685           !include-raw-escape: ./apex-snapshot-create.sh
686
687 # snapshot upload
688 - job-template:
689     name: 'apex-upload-snapshot'
690
691     disabled: false
692
693     parameters:
694       - '{project}-defaults'
695
696     builders:
697       - inject:
698           properties-content: ARTIFACT_TYPE=snapshot
699       - 'apex-upload-artifact'
700
701 # CSIT promote
702 - job-template:
703     name: 'apex-csit-promote-daily-{stream}-os-{os_version}-{topology}'
704
705     # Job template for promoting CSIT Snapshots
706     #
707     # Required Variables:
708     #     stream:    branch with - in place of / (eg. stable)
709     #     branch:    branch (eg. stable)
710     node: '{virtual-slave}'
711     project-type: 'multijob'
712     disabled: '{disable_promote}'
713
714     scm:
715       - git-scm
716
717     parameters:
718       - project-parameter:
719           project: '{project}'
720           branch: '{branch}'
721       - apex-parameter:
722           gs-pathname: '{gs-pathname}'
723       - string:
724           name: ARTIFACT_VERSION
725           default: dev
726           description: "Used for overriding the ARTIFACT_VERSION"
727       - string:
728           name: PROMOTE
729           default: 'True'
730           description: "Used for overriding the PROMOTE"
731       - string:
732           name: GS_URL
733           default: $GS_BASE{gs-pathname}/{os_version}/{topology}
734           description: "User for overriding GS_URL from apex params"
735       - string:
736           name: OS_VERSION
737           default: '{os_version}'
738           description: OpenStack version short name
739       - string:
740           name: ODL_BRANCH
741           default: '{odl_branch}'
742           description: ODL branch being used
743
744     properties:
745       - build-blocker:
746           use-build-blocker: true
747           block-level: 'NODE'
748           blocking-jobs:
749             - 'apex-verify.*'
750             - 'apex-runner.*'
751             - 'apex-daily.*'
752             - 'apex-csit-promote.*'
753             - 'odl-netvirt.*'
754       - throttle:
755           max-per-node: 1
756           max-total: 10
757           option: 'project'
758
759     triggers:
760       - '{stream}-{os_version}'
761
762     builders:
763       - multijob:
764           name: apex-virtual-deploy
765           condition: SUCCESSFUL
766           projects:
767             - name: 'apex-deploy-virtual-{stream}'
768               current-parameters: true
769               predefined-parameters: |
770                 DEPLOY_SCENARIO=os-odl-{os_scenario}-{topology}
771                 OPNFV_CLEAN=yes
772                 GERRIT_BRANCH=$GERRIT_BRANCH
773                 GERRIT_REFSPEC=$GERRIT_REFSPEC
774                 GERRIT_CHANGE_NUMBER=$GERRIT_CHANGE_NUMBER
775                 GERRIT_CHANGE_COMMIT_MESSAGE=$GERRIT_CHANGE_COMMIT_MESSAGE
776               node-parameters: true
777               kill-phase-on: FAILURE
778               abort-all-job: true
779               git-revision: true
780       - multijob:
781           name: fetch snapshot info
782           condition: SUCCESSFUL
783           projects:
784             - name: 'apex-fetch-snap-info'
785               current-parameters: true
786               node-parameters: true
787               kill-phase-on: FAILURE
788               abort-all-job: true
789               git-revision: false
790       - multijob:
791           name: csit
792           condition: SUCCESSFUL
793           execution-type: SEQUENTIALLY
794           projects:
795             - name: cperf-apex-csit-master
796               predefined-parameters: |
797                 ODL_BRANCH=$ODL_BRANCH
798                 RC_FILE_PATH=/tmp/csit/overcloudrc
799                 NODE_FILE_PATH=/tmp/csit/node.yaml
800                 SSH_KEY_PATH=/tmp/csit/id_rsa
801                 ODL_CONTAINERIZED=true
802                 OS_VERSION=$OS_VERSION
803               node-parameters: true
804               kill-phase-on: NEVER
805               abort-all-job: false
806             - name: cperf-upload-logs-csit
807               predefined-parameters: |
808                 ODL_BRANCH=$ODL_BRANCH
809                 OS_VERSION=$OS_VERSION
810               node-parameters: true
811               kill-phase-on: FAILURE
812               abort-all-job: false
813             - name: 'apex-fetch-logs-{stream}'
814               current-parameters: false
815               predefined-parameters: |
816                 GERRIT_BRANCH=$GERRIT_BRANCH
817                 GERRIT_REFSPEC=$GERRIT_REFSPEC
818                 GERRIT_CHANGE_NUMBER=$GERRIT_CHANGE_NUMBER
819                 GERRIT_CHANGE_COMMIT_MESSAGE=$GERRIT_CHANGE_COMMIT_MESSAGE
820               node-parameters: true
821               kill-phase-on: NEVER
822               abort-all-job: true
823               git-revision: false
824       - multijob:
825           name: create snapshot
826           condition: SUCCESSFUL
827           projects:
828             - name: 'apex-create-snapshot'
829               current-parameters: true
830               predefined-parameters: |
831                 SNAP_TYPE=csit
832               node-parameters: true
833               kill-phase-on: FAILURE
834               abort-all-job: true
835               git-revision: false
836       - multijob:
837           name: upload snapshot
838           condition: SUCCESSFUL
839           projects:
840             - name: 'apex-upload-snapshot'
841               current-parameters: true
842               predefined-parameters: |
843                 SNAP_TYPE=csit
844               node-parameters: true
845               kill-phase-on: FAILURE
846               abort-all-job: true
847               git-revision: false
848
849 # FDIO promote
850 - job-template:
851     name: 'apex-fdio-promote-daily-{stream}'
852
853     # Job template for promoting CSIT Snapshots
854     #
855     # Required Variables:
856     #     stream:    branch with - in place of / (eg. stable)
857     #     branch:    branch (eg. stable)
858     node: '{virtual-slave}'
859     project-type: 'multijob'
860     disabled: false
861
862     scm:
863       - git-scm
864
865     parameters:
866       - project-parameter:
867           project: '{project}'
868           branch: '{branch}'
869       - apex-parameter:
870           gs-pathname: '{gs-pathname}'
871
872     properties:
873       - build-blocker:
874           use-build-blocker: true
875           block-level: 'NODE'
876           blocking-jobs:
877             - 'apex-verify.*'
878             - 'apex-deploy.*'
879             - 'apex-runner.*'
880             - 'apex-daily.*'
881
882     builders:
883       - multijob:
884           name: build
885           condition: SUCCESSFUL
886           projects:
887             - name: 'apex-build-{stream}'
888               current-parameters: false
889               predefined-parameters: |
890                 GERRIT_BRANCH=$GERRIT_BRANCH
891                 GERRIT_REFSPEC=$GERRIT_REFSPEC
892                 GERRIT_CHANGE_NUMBER=$GERRIT_CHANGE_NUMBER
893                 GERRIT_CHANGE_COMMIT_MESSAGE=$GERRIT_CHANGE_COMMIT_MESSAGE
894               node-parameters: false
895               kill-phase-on: FAILURE
896               abort-all-job: true
897               git-revision: true
898       - multijob:
899           name: deploy-virtual
900           condition: SUCCESSFUL
901           projects:
902             - name: 'apex-deploy-virtual-{stream}'
903               current-parameters: false
904               predefined-parameters: |
905                 DEPLOY_SCENARIO=os-odl_netvirt-fdio-noha
906                 OPNFV_CLEAN=yes
907                 GERRIT_BRANCH=$GERRIT_BRANCH
908                 GERRIT_REFSPEC=$GERRIT_REFSPEC
909                 GERRIT_CHANGE_NUMBER=$GERRIT_CHANGE_NUMBER
910                 GERRIT_CHANGE_COMMIT_MESSAGE=$GERRIT_CHANGE_COMMIT_MESSAGE
911                 PROMOTE=True
912               node-parameters: true
913               kill-phase-on: FAILURE
914               abort-all-job: true
915               git-revision: false
916       - multijob:
917           name: create snapshot
918           condition: SUCCESSFUL
919           projects:
920             - name: 'apex-create-snapshot'
921               current-parameters: false
922               predefined-parameters: |
923                 SNAP_TYPE=fdio
924               node-parameters: true
925               kill-phase-on: FAILURE
926               abort-all-job: true
927               git-revision: false
928       - multijob:
929           name: upload snapshot
930           condition: SUCCESSFUL
931           projects:
932             - name: 'apex-upload-snapshot'
933               current-parameters: false
934               predefined-parameters: |
935                 SNAP_TYPE=fdio
936               node-parameters: true
937               kill-phase-on: FAILURE
938               abort-all-job: true
939               git-revision: false
940
941 # Flex job
942 - job-template:
943     name: 'apex-flex-daily-os-nosdn-nofeature-ha-{stream}'
944
945     project-type: 'multijob'
946
947     disabled: false
948
949     node: 'flex-pod2'
950
951     scm:
952       - git-scm
953
954     triggers:
955       - 'apex-{stream}'
956
957     parameters:
958       - '{project}-defaults'
959       - project-parameter:
960           project: '{project}'
961           branch: '{branch}'
962       - apex-parameter:
963           gs-pathname: '{gs-pathname}'
964       - string:
965           name: DEPLOY_SCENARIO
966           default: 'os-nosdn-nofeature-ha'
967           description: "Scenario to deploy with."
968       - string:
969           name: GIT_BASE
970           default: https://gerrit.opnfv.org/gerrit/$PROJECT
971           description: 'Git URL to use on this Jenkins Slave'
972       - string:
973           name: SSH_KEY
974           default: /root/.ssh/id_rsa
975           description: 'SSH key to use for Apex'
976
977     properties:
978       - logrotate-default
979       - build-blocker:
980           use-build-blocker: true
981           block-level: 'NODE'
982           blocking-jobs:
983             - 'apex-verify.*'
984             - 'apex-runner.*'
985             - 'apex-.*-promote.*'
986             - 'apex-run.*'
987             - 'apex-.+-baremetal-.+'
988       - throttle:
989           max-per-node: 1
990           max-total: 10
991           option: 'project'
992
993     builders:
994       - description-setter:
995           description: "Deployed on $NODE_NAME - Scenario: $DEPLOY_SCENARIO"
996       - multijob:
997           name: 'Baremetal Deploy'
998           condition: SUCCESSFUL
999           projects:
1000             - name: 'apex-deploy-baremetal-{stream}'
1001               node-parameters: true
1002               current-parameters: true
1003               predefined-parameters: |
1004                 OPNFV_CLEAN=yes
1005                 GERRIT_BRANCH=$GERRIT_BRANCH
1006                 GERRIT_REFSPEC=
1007                 DEPLOY_SCENARIO=$DEPLOY_SCENARIO
1008               kill-phase-on: FAILURE
1009               abort-all-job: true
1010               git-revision: false
1011       - multijob:
1012           name: Yardstick
1013           condition: ALWAYS
1014           projects:
1015             - name: 'yardstick-apex-baremetal-daily-{stream}'
1016               node-parameters: true
1017               current-parameters: false
1018               predefined-parameters:
1019                 DEPLOY_SCENARIO=$DEPLOY_SCENARIO
1020               kill-phase-on: NEVER
1021               abort-all-job: false
1022               git-revision: false
1023
1024 # Dovetail Danube test job
1025 - job-template:
1026     name: 'apex-dovetail-daily-os-nosdn-nofeature-ha-baremetal-danube'
1027
1028     project-type: 'multijob'
1029
1030     node: 'huawei-pod4'
1031
1032     disabled: false
1033
1034     parameters:
1035       - '{project}-defaults'
1036       - project-parameter:
1037           project: '{project}'
1038           branch: 'stable/danube'
1039       - apex-parameter:
1040           gs-pathname: '/danube'
1041       - string:
1042           name: DEPLOY_SCENARIO
1043           default: 'os-nosdn-nofeature-ha'
1044           description: "Scenario to deploy with."
1045
1046     properties:
1047       - logrotate-default
1048       - build-blocker:
1049           use-build-blocker: true
1050           block-level: 'NODE'
1051           blocking-jobs:
1052             - 'apex-verify.*'
1053             - 'apex-runner.*'
1054             - 'apex-.*-promote.*'
1055             - 'apex-run.*'
1056
1057     triggers:
1058       - timed: ''  # '0 1 * * *'
1059
1060     builders:
1061       - description-setter:
1062           description: "Testing on $NODE_NAME - Scenario: $DEPLOY_SCENARIO"
1063       - multijob:
1064           name: 'Baremetal Deploy'
1065           condition: SUCCESSFUL
1066           projects:
1067             - name: 'apex-deploy-baremetal-danube'
1068               node-parameters: true
1069               current-parameters: true
1070               predefined-parameters: |
1071                 OPNFV_CLEAN=yes
1072                 GERRIT_BRANCH=$GERRIT_BRANCH
1073                 GERRIT_REFSPEC=
1074                 DEPLOY_SCENARIO=$DEPLOY_SCENARIO
1075               kill-phase-on: FAILURE
1076               abort-all-job: true
1077               git-revision: false
1078       - multijob:
1079           name: Dovetail
1080           condition: ALWAYS
1081           projects:
1082             - name: 'dovetail-apex-baremetal-proposed_tests-danube'
1083               node-parameters: true
1084               current-parameters: false
1085               predefined-parameters:
1086                 DEPLOY_SCENARIO=$DEPLOY_SCENARIO
1087               kill-phase-on: NEVER
1088               abort-all-job: false
1089               git-revision: false
1090
1091 ########################
1092 # parameter macros
1093 ########################
1094 - parameter:
1095     name: apex-parameter
1096     parameters:
1097       - string:
1098           name: ARTIFACT_NAME
1099           default: 'latest'
1100           description: "RPM Artifact name that will be appended to GS_URL to deploy a specific artifact"
1101       - string:
1102           name: ARTIFACT_VERSION
1103           default: 'daily'
1104           description: "Artifact version type"
1105       - string:
1106           name: BUILD_DIRECTORY
1107           default: $WORKSPACE/.build
1108           description: "Directory where the build artifact will be located upon the completion of the build."
1109       - string:
1110           name: CACHE_DIRECTORY
1111           default: $HOME/opnfv/apex-cache{gs-pathname}
1112           description: "Directory where the cache to be used during the build is located."
1113       # yamllint disable rule:line-length
1114       - string:
1115           name: GIT_BASE
1116           default: https://gerrit.opnfv.org/gerrit/$PROJECT
1117           description: "Used for overriding the GIT URL coming from Global Jenkins configuration in case if the stuff is done on none-LF HW."
1118       # yamllint enable rule:line-length
1119       - string:
1120           name: GS_PATHNAME
1121           default: '{gs-pathname}'
1122           description: "Version directory where opnfv artifacts are stored in gs repository"
1123       - string:
1124           name: GS_URL
1125           default: $GS_BASE{gs-pathname}
1126           description: "URL to Google Storage."
1127       - string:
1128           name: PROMOTE
1129           default: 'False'
1130           description: "Flag to know if we should promote/upload snapshot artifacts."
1131
1132 ########################
1133 # builder macros
1134 ########################
1135 {% for stream in scenarios %}
1136 # {{ stream }} Builder
1137 - builder:
1138     name: apex-builder-{{ stream }}
1139     builders:
1140       - multijob:
1141           name: Baremetal Deploy and Test Phase
1142           condition: SUCCESSFUL
1143           projects:
1144 {%- for scenario in scenarios[stream] %}
1145             - name: 'apex-{{ scenario }}-baremetal-{{ stream }}'
1146               node-parameters: false
1147               current-parameters: false
1148               predefined-parameters: |
1149                 OPNFV_CLEAN=yes
1150               kill-phase-on: NEVER
1151               abort-all-job: true
1152               git-revision: false
1153 {%- endfor %}
1154 {% endfor -%}
1155
1156 - builder:
1157     name: 'apex-upload-artifact'
1158     builders:
1159       - shell:
1160           !include-raw: ./apex-upload-artifact.sh
1161
1162 - builder:
1163     name: 'apex-download-artifact'
1164     builders:
1165       - shell:
1166           !include-raw: ./apex-download-artifact.sh
1167
1168 - builder:
1169     name: 'apex-deploy'
1170     builders:
1171       - shell:
1172           !include-raw: ./apex-deploy.sh
1173
1174 - builder:
1175     name: 'apex-fetch-logs'
1176     builders:
1177       - shell:
1178           !include-raw: ./apex-fetch-logs.sh
1179
1180 #######################
1181 # trigger macros
1182 # timed is in format: 'min hour daymonth month dayweek'
1183 ########################
1184 - trigger:
1185     name: 'apex-master'
1186     triggers:
1187       - timed: '0 0 1-31/2 * *'
1188
1189 - trigger:
1190     name: 'apex-gambia'
1191     triggers:
1192       - timed: '0 4 2-30/2 * *'
1193
1194 - trigger:
1195     name: 'apex-fraser'
1196     triggers:
1197       - timed: '0 0 2-30/2 * *'
1198
1199 - trigger:
1200     name: 'apex-euphrates'
1201     triggers:
1202       - timed: '0 0 2-30/2 * *'
1203
1204 - trigger:
1205     name: 'apex-danube'
1206     triggers:
1207       - timed: '0 3 1 1 7'
1208
1209 - trigger:
1210     name: 'master-master'
1211     triggers:
1212       - timed: '0 12 * * *'
1213
1214 - trigger:
1215     name: 'master-rocky'
1216     triggers:
1217       - timed: '0 12 * * *'
1218
1219 - trigger:
1220     name: 'master-queens'
1221     triggers:
1222       - timed: ''
1223
1224 - trigger:
1225     name: 'gambia-master'
1226     triggers:
1227       - timed: ''
1228
1229 - trigger:
1230     name: 'gambia-rocky'
1231     triggers:
1232       - timed: ''
1233
1234 - trigger:
1235     name: 'gambia-queens'
1236     triggers:
1237       - timed: '0 12 * * *'
1238
1239 - trigger:
1240     name: 'fraser-master'
1241     triggers:
1242       - timed: ''
1243
1244 - trigger:
1245     name: 'fraser-rocky'
1246     triggers:
1247       - timed: ''
1248
1249 - trigger:
1250     name: 'fraser-queens'
1251     triggers:
1252       - timed: ''
1253
1254 - trigger:
1255     name: 'euphrates-master'
1256     triggers:
1257       - timed: ''
1258
1259 - trigger:
1260     name: 'euphrates-rocky'
1261     triggers:
1262       - timed: ''
1263
1264 - trigger:
1265     name: 'euphrates-queens'
1266     triggers:
1267       - timed: ''
1268
1269 - trigger:
1270     name: 'danube-master'
1271     triggers:
1272       - timed: ''
1273
1274 - trigger:
1275     name: 'danube-rocky'
1276     triggers:
1277       - timed: ''
1278
1279 - trigger:
1280     name: 'danube-queens'
1281     triggers:
1282       - timed: ''