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