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