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