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