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