Apex: Add allinone snapshot job
[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       - multijob:
804           name: create snapshot
805           condition: SUCCESSFUL
806           projects:
807             - name: 'apex-create-snapshot'
808               current-parameters: true
809               predefined-parameters: |
810                 SNAP_TYPE=csit
811               node-parameters: true
812               kill-phase-on: FAILURE
813               abort-all-job: true
814               git-revision: false
815       - multijob:
816           name: upload snapshot
817           condition: SUCCESSFUL
818           projects:
819             - name: 'apex-upload-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
828 # FDIO promote
829 - job-template:
830     name: 'apex-fdio-promote-daily-{stream}'
831
832     # Job template for promoting CSIT Snapshots
833     #
834     # Required Variables:
835     #     stream:    branch with - in place of / (eg. stable)
836     #     branch:    branch (eg. stable)
837     node: '{virtual-slave}'
838     project-type: 'multijob'
839     disabled: false
840
841     scm:
842       - git-scm
843
844     parameters:
845       - project-parameter:
846           project: '{project}'
847           branch: '{branch}'
848       - apex-parameter:
849           gs-pathname: '{gs-pathname}'
850
851     properties:
852       - build-blocker:
853           use-build-blocker: true
854           block-level: 'NODE'
855           blocking-jobs:
856             - 'apex-verify.*'
857             - 'apex-deploy.*'
858             - 'apex-runner.*'
859             - 'apex-daily.*'
860
861     builders:
862       - multijob:
863           name: build
864           condition: SUCCESSFUL
865           projects:
866             - name: 'apex-build-{stream}'
867               current-parameters: false
868               predefined-parameters: |
869                 GERRIT_BRANCH=$GERRIT_BRANCH
870                 GERRIT_REFSPEC=$GERRIT_REFSPEC
871                 GERRIT_CHANGE_NUMBER=$GERRIT_CHANGE_NUMBER
872                 GERRIT_CHANGE_COMMIT_MESSAGE=$GERRIT_CHANGE_COMMIT_MESSAGE
873               node-parameters: false
874               kill-phase-on: FAILURE
875               abort-all-job: true
876               git-revision: true
877       - multijob:
878           name: deploy-virtual
879           condition: SUCCESSFUL
880           projects:
881             - name: 'apex-deploy-virtual-{stream}'
882               current-parameters: false
883               predefined-parameters: |
884                 DEPLOY_SCENARIO=os-odl_netvirt-fdio-noha
885                 OPNFV_CLEAN=yes
886                 GERRIT_BRANCH=$GERRIT_BRANCH
887                 GERRIT_REFSPEC=$GERRIT_REFSPEC
888                 GERRIT_CHANGE_NUMBER=$GERRIT_CHANGE_NUMBER
889                 GERRIT_CHANGE_COMMIT_MESSAGE=$GERRIT_CHANGE_COMMIT_MESSAGE
890                 PROMOTE=True
891               node-parameters: true
892               kill-phase-on: FAILURE
893               abort-all-job: true
894               git-revision: false
895       - multijob:
896           name: create snapshot
897           condition: SUCCESSFUL
898           projects:
899             - name: 'apex-create-snapshot'
900               current-parameters: false
901               predefined-parameters: |
902                 SNAP_TYPE=fdio
903               node-parameters: true
904               kill-phase-on: FAILURE
905               abort-all-job: true
906               git-revision: false
907       - multijob:
908           name: upload snapshot
909           condition: SUCCESSFUL
910           projects:
911             - name: 'apex-upload-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
920 # Flex job
921 - job-template:
922     name: 'apex-flex-daily-os-nosdn-nofeature-ha-{stream}'
923
924     project-type: 'multijob'
925
926     disabled: false
927
928     node: 'flex-pod2'
929
930     scm:
931       - git-scm
932
933     triggers:
934       - 'apex-{stream}'
935
936     parameters:
937       - '{project}-defaults'
938       - project-parameter:
939           project: '{project}'
940           branch: '{branch}'
941       - apex-parameter:
942           gs-pathname: '{gs-pathname}'
943       - string:
944           name: DEPLOY_SCENARIO
945           default: 'os-nosdn-nofeature-ha'
946           description: "Scenario to deploy with."
947       - string:
948           name: GIT_BASE
949           default: https://gerrit.opnfv.org/gerrit/$PROJECT
950           description: 'Git URL to use on this Jenkins Slave'
951       - string:
952           name: SSH_KEY
953           default: /root/.ssh/id_rsa
954           description: 'SSH key to use for Apex'
955
956     properties:
957       - logrotate-default
958       - build-blocker:
959           use-build-blocker: true
960           block-level: 'NODE'
961           blocking-jobs:
962             - 'apex-verify.*'
963             - 'apex-runner.*'
964             - 'apex-.*-promote.*'
965             - 'apex-run.*'
966             - 'apex-.+-baremetal-.+'
967       - throttle:
968           max-per-node: 1
969           max-total: 10
970           option: 'project'
971
972     builders:
973       - description-setter:
974           description: "Deployed on $NODE_NAME - Scenario: $DEPLOY_SCENARIO"
975       - multijob:
976           name: 'Baremetal Deploy'
977           condition: SUCCESSFUL
978           projects:
979             - name: 'apex-deploy-baremetal-{stream}'
980               node-parameters: true
981               current-parameters: true
982               predefined-parameters: |
983                 OPNFV_CLEAN=yes
984                 GERRIT_BRANCH=$GERRIT_BRANCH
985                 GERRIT_REFSPEC=
986                 DEPLOY_SCENARIO=$DEPLOY_SCENARIO
987               kill-phase-on: FAILURE
988               abort-all-job: true
989               git-revision: false
990       - multijob:
991           name: Yardstick
992           condition: ALWAYS
993           projects:
994             - name: 'yardstick-apex-baremetal-daily-{stream}'
995               node-parameters: true
996               current-parameters: false
997               predefined-parameters:
998                 DEPLOY_SCENARIO=$DEPLOY_SCENARIO
999               kill-phase-on: NEVER
1000               abort-all-job: false
1001               git-revision: false
1002
1003 # Dovetail Danube test job
1004 - job-template:
1005     name: 'apex-dovetail-daily-os-nosdn-nofeature-ha-baremetal-danube'
1006
1007     project-type: 'multijob'
1008
1009     node: 'huawei-pod4'
1010
1011     disabled: false
1012
1013     parameters:
1014       - '{project}-defaults'
1015       - project-parameter:
1016           project: '{project}'
1017           branch: 'stable/danube'
1018       - apex-parameter:
1019           gs-pathname: '/danube'
1020       - string:
1021           name: DEPLOY_SCENARIO
1022           default: 'os-nosdn-nofeature-ha'
1023           description: "Scenario to deploy with."
1024
1025     properties:
1026       - logrotate-default
1027       - build-blocker:
1028           use-build-blocker: true
1029           block-level: 'NODE'
1030           blocking-jobs:
1031             - 'apex-verify.*'
1032             - 'apex-runner.*'
1033             - 'apex-.*-promote.*'
1034             - 'apex-run.*'
1035
1036     triggers:
1037       - timed: ''  # '0 1 * * *'
1038
1039     builders:
1040       - description-setter:
1041           description: "Testing on $NODE_NAME - Scenario: $DEPLOY_SCENARIO"
1042       - multijob:
1043           name: 'Baremetal Deploy'
1044           condition: SUCCESSFUL
1045           projects:
1046             - name: 'apex-deploy-baremetal-danube'
1047               node-parameters: true
1048               current-parameters: true
1049               predefined-parameters: |
1050                 OPNFV_CLEAN=yes
1051                 GERRIT_BRANCH=$GERRIT_BRANCH
1052                 GERRIT_REFSPEC=
1053                 DEPLOY_SCENARIO=$DEPLOY_SCENARIO
1054               kill-phase-on: FAILURE
1055               abort-all-job: true
1056               git-revision: false
1057       - multijob:
1058           name: Dovetail
1059           condition: ALWAYS
1060           projects:
1061             - name: 'dovetail-apex-baremetal-proposed_tests-danube'
1062               node-parameters: true
1063               current-parameters: false
1064               predefined-parameters:
1065                 DEPLOY_SCENARIO=$DEPLOY_SCENARIO
1066               kill-phase-on: NEVER
1067               abort-all-job: false
1068               git-revision: false
1069
1070 ########################
1071 # parameter macros
1072 ########################
1073 - parameter:
1074     name: apex-parameter
1075     parameters:
1076       - string:
1077           name: ARTIFACT_NAME
1078           default: 'latest'
1079           description: "RPM Artifact name that will be appended to GS_URL to deploy a specific artifact"
1080       - string:
1081           name: ARTIFACT_VERSION
1082           default: 'daily'
1083           description: "Artifact version type"
1084       - string:
1085           name: BUILD_DIRECTORY
1086           default: $WORKSPACE/.build
1087           description: "Directory where the build artifact will be located upon the completion of the build."
1088       - string:
1089           name: CACHE_DIRECTORY
1090           default: $HOME/opnfv/apex-cache{gs-pathname}
1091           description: "Directory where the cache to be used during the build is located."
1092       # yamllint disable rule:line-length
1093       - string:
1094           name: GIT_BASE
1095           default: https://gerrit.opnfv.org/gerrit/$PROJECT
1096           description: "Used for overriding the GIT URL coming from Global Jenkins configuration in case if the stuff is done on none-LF HW."
1097       # yamllint enable rule:line-length
1098       - string:
1099           name: GS_PATHNAME
1100           default: '{gs-pathname}'
1101           description: "Version directory where opnfv artifacts are stored in gs repository"
1102       - string:
1103           name: GS_URL
1104           default: $GS_BASE{gs-pathname}
1105           description: "URL to Google Storage."
1106       - string:
1107           name: PROMOTE
1108           default: 'False'
1109           description: "Flag to know if we should promote/upload snapshot artifacts."
1110
1111 ########################
1112 # builder macros
1113 ########################
1114 {% for stream in scenarios %}
1115 # {{ stream }} Builder
1116 - builder:
1117     name: apex-builder-{{ stream }}
1118     builders:
1119       - multijob:
1120           name: Baremetal Deploy and Test Phase
1121           condition: SUCCESSFUL
1122           projects:
1123 {%- for scenario in scenarios[stream] %}
1124             - name: 'apex-{{ scenario }}-baremetal-{{ stream }}'
1125               node-parameters: false
1126               current-parameters: false
1127               predefined-parameters: |
1128                 OPNFV_CLEAN=yes
1129               kill-phase-on: NEVER
1130               abort-all-job: true
1131               git-revision: false
1132 {%- endfor %}
1133 {% endfor -%}
1134
1135 - builder:
1136     name: 'apex-upload-artifact'
1137     builders:
1138       - shell:
1139           !include-raw: ./apex-upload-artifact.sh
1140
1141 - builder:
1142     name: 'apex-download-artifact'
1143     builders:
1144       - shell:
1145           !include-raw: ./apex-download-artifact.sh
1146
1147 - builder:
1148     name: 'apex-deploy'
1149     builders:
1150       - shell:
1151           !include-raw: ./apex-deploy.sh
1152
1153 - builder:
1154     name: 'apex-fetch-logs'
1155     builders:
1156       - shell:
1157           !include-raw: ./apex-fetch-logs.sh
1158
1159 #######################
1160 # trigger macros
1161 ########################
1162 - trigger:
1163     name: 'apex-master'
1164     triggers:
1165       - timed: '0 0 1-31/2 * *'
1166
1167 - trigger:
1168     name: 'apex-fraser'
1169     triggers:
1170       - timed: '0 0 2-30/2 * *'
1171
1172 - trigger:
1173     name: 'apex-euphrates'
1174     triggers:
1175       - timed: '0 0 2-30/2 * *'
1176
1177 - trigger:
1178     name: 'apex-danube'
1179     triggers:
1180       - timed: '0 3 1 1 7'