Merge "[Dovetail] Changing the path of the ssh key in pod.yaml for yardstick"
[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}'
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-odl-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-odl-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       - 'queens'
79       - 'master'
80
81
82 # Fetch Logs Job
83 - job-template:
84     name: 'apex-fetch-logs-{stream}'
85
86     concurrent: true
87
88     disabled: false
89     scm:
90       - git-scm-gerrit
91     parameters:
92       - project-parameter:
93           project: '{project}'
94           branch: '{branch}'
95       - apex-parameter:
96           gs-pathname: '{gs-pathname}'
97     # yamllint enable rule:line-length
98     properties:
99       - logrotate-default
100       - throttle:
101           max-per-node: 1
102           max-total: 10
103           option: 'project'
104
105     builders:
106       - 'apex-fetch-logs'
107
108 - job-template:
109     name: 'apex-runner-cperf-{stream}'
110
111     # runner cperf job
112     project-type: 'multijob'
113     node: 'intel-pod2'
114
115     disabled: false
116
117     parameters:
118       - apex-parameter:
119           gs-pathname: '{gs-pathname}'
120       - project-parameter:
121           project: '{project}'
122           branch: '{branch}'
123       - string:
124           name: GIT_BASE
125           default: https://gerrit.opnfv.org/gerrit/$PROJECT
126           description: "Used for overriding the GIT URL coming from parameters macro."
127
128     scm:
129       - git-scm
130
131     properties:
132       - logrotate-default
133       - build-blocker:
134           use-build-blocker: false
135           block-level: 'NODE'
136           blocking-jobs:
137             - 'apex-deploy.*'
138       - throttle:
139           max-per-node: 1
140           max-total: 10
141           option: 'project'
142
143     builders:
144       - description-setter:
145           description: "Deployed on $NODE_NAME"
146       - multijob:
147           name: 'Baremetal Deploy'
148           condition: ALWAYS
149           projects:
150             - name: 'apex-deploy-baremetal-{stream}'
151               node-parameters: false
152               current-parameters: true
153               predefined-parameters: |
154                 GERRIT_BRANCH=$GERRIT_BRANCH
155                 GERRIT_REFSPEC=
156                 OPNFV_CLEAN=yes
157                 DEPLOY_SCENARIO={verify-scenario}
158               kill-phase-on: FAILURE
159               abort-all-job: true
160               git-revision: false
161       - multijob:
162           name: CPERF
163           condition: SUCCESSFUL
164           projects:
165             - name: 'cperf-apex-intel-pod2-daily-master'
166               node-parameters: true
167               current-parameters: false
168               predefined-parameters:
169                 DEPLOY_SCENARIO={verify-scenario}
170               kill-phase-on: NEVER
171               abort-all-job: false
172               git-revision: false
173
174 # Deploy job
175 - job-template:
176     name: 'apex-deploy-{platform}-{stream}'
177
178     concurrent: true
179
180     disabled: false
181     quiet-period: 30
182     scm:
183       - git-scm-gerrit
184
185     wrappers:
186       - timeout:
187           timeout: 140
188           fail: true
189
190     parameters:
191       - '{project}-{platform}-{stream}-defaults'
192       - project-parameter:
193           project: '{project}'
194           branch: '{branch}'
195       - apex-parameter:
196           gs-pathname: '{gs-pathname}'
197       - string:
198           name: DEPLOY_SCENARIO
199           default: '{verify-scenario}'
200           description: "Scenario to deploy with."
201       # yamllint disable rule:line-length
202       - string:
203           name: OPNFV_CLEAN
204           default: 'no'
205           description: "Use yes in lower case to invoke clean. Indicates if the deploy environment should be cleaned before deployment"
206
207     # yamllint enable rule:line-length
208     properties:
209       - logrotate-default
210       - build-blocker:
211           use-build-blocker: true
212           block-level: 'NODE'
213           blocking-jobs:
214             - 'apex-deploy.*'
215             - 'functest.*'
216             - 'yardstick.*'
217             - 'dovetail.*'
218             - 'storperf.*'
219       - throttle:
220           max-per-node: 1
221           max-total: 10
222           option: 'project'
223
224     builders:
225       - description-setter:
226           description: "Deployed on $NODE_NAME - Scenario: $DEPLOY_SCENARIO"
227       - 'apex-download-artifact'
228       - 'apex-deploy'
229       - 'clean-workspace'
230
231
232 # Virtual Deploy and Test
233 - job-template:
234     name: 'apex-virtual-{stream}'
235
236     project-type: 'multijob'
237
238     concurrent: true
239
240     disabled: false
241
242     scm:
243       - git-scm-gerrit
244
245     parameters:
246       - '{project}-defaults'
247       - '{project}-virtual-{stream}-defaults'
248       - project-parameter:
249           project: '{project}'
250           branch: '{branch}'
251       - apex-parameter:
252           gs-pathname: '{gs-pathname}'
253       - string:
254           name: DEPLOY_SCENARIO
255           default: '{verify-scenario}'
256           description: "Scenario to deploy with."
257       - string:
258           name: ARTIFACT_VERSION
259           default: dev
260           description: "Used for overriding the ARTIFACT_VERSION"
261
262     properties:
263       - logrotate-default
264       - build-blocker:
265           use-build-blocker: true
266           block-level: 'NODE'
267           blocking-jobs:
268             - 'apex-runner.*'
269             - 'apex-.*-promote.*'
270             - 'apex-run.*'
271             - 'apex-virtual-.*'
272             - 'apex-verify-gate-.*'
273       - throttle:
274           max-per-node: 1
275           max-total: 10
276           option: 'project'
277
278     builders:
279       - description-setter:
280           description: "Deployed on $NODE_NAME - Scenario: $DEPLOY_SCENARIO"
281       - multijob:
282           name: deploy-virtual
283           condition: SUCCESSFUL
284           projects:
285             - name: 'apex-deploy-virtual-{stream}'
286               current-parameters: false
287               predefined-parameters: |
288                 ARTIFACT_VERSION=$ARTIFACT_VERSION
289                 DEPLOY_SCENARIO=$DEPLOY_SCENARIO
290                 OPNFV_CLEAN=yes
291                 GERRIT_BRANCH=$GERRIT_BRANCH
292                 GERRIT_REFSPEC=$GERRIT_REFSPEC
293                 GERRIT_CHANGE_NUMBER=$GERRIT_CHANGE_NUMBER
294                 GERRIT_CHANGE_COMMIT_MESSAGE=$GERRIT_CHANGE_COMMIT_MESSAGE
295               node-parameters: true
296               kill-phase-on: FAILURE
297               abort-all-job: true
298               git-revision: true
299       - multijob:
300           name: functest-smoke
301           condition: ALWAYS
302           projects:
303             - name: 'functest-apex-virtual-suite-{stream}'
304               current-parameters: false
305               predefined-parameters: |
306                 DEPLOY_SCENARIO=$DEPLOY_SCENARIO
307                 FUNCTEST_SUITE_NAME=healthcheck
308                 GERRIT_BRANCH=$GERRIT_BRANCH
309                 GERRIT_REFSPEC=$GERRIT_REFSPEC
310                 GERRIT_CHANGE_NUMBER=$GERRIT_CHANGE_NUMBER
311                 GERRIT_CHANGE_COMMIT_MESSAGE=$GERRIT_CHANGE_COMMIT_MESSAGE
312               node-parameters: true
313               kill-phase-on: NEVER
314               abort-all-job: true
315               git-revision: false
316       - multijob:
317           name: apex-fetch-logs
318           projects:
319             - name: 'apex-fetch-logs-{stream}'
320               current-parameters: false
321               predefined-parameters: |
322                 GERRIT_BRANCH=$GERRIT_BRANCH
323                 GERRIT_REFSPEC=$GERRIT_REFSPEC
324                 GERRIT_CHANGE_NUMBER=$GERRIT_CHANGE_NUMBER
325                 GERRIT_CHANGE_COMMIT_MESSAGE=$GERRIT_CHANGE_COMMIT_MESSAGE
326               node-parameters: true
327               kill-phase-on: NEVER
328               abort-all-job: true
329               git-revision: false
330
331 # Baremetal Deploy and Test
332 - job-template:
333     name: 'apex-{scenario}-baremetal-{scenario_stream}'
334
335     project-type: 'multijob'
336
337     disabled: false
338
339     scm:
340       - git-scm
341
342     parameters:
343       - '{project}-defaults'
344       - '{project}-baremetal-{scenario_stream}-defaults'
345       - project-parameter:
346           project: '{project}'
347           branch: '{branch}'
348       - apex-parameter:
349           gs-pathname: '{gs-pathname}'
350       - string:
351           name: DEPLOY_SCENARIO
352           default: '{scenario}'
353           description: "Scenario to deploy with."
354
355     properties:
356       - logrotate-default
357       - build-blocker:
358           use-build-blocker: true
359           block-level: 'NODE'
360           blocking-jobs:
361             - 'apex-verify.*'
362             - 'apex-runner.*'
363             - 'apex-.*-promote.*'
364             - 'apex-run.*'
365             - 'apex-.+-baremetal-.+'
366       - throttle:
367           max-per-node: 1
368           max-total: 10
369           option: 'project'
370
371     builders:
372       - description-setter:
373           description: "Deployed on $NODE_NAME - Scenario: $DEPLOY_SCENARIO"
374       - multijob:
375           name: 'Baremetal Deploy'
376           condition: SUCCESSFUL
377           execution-type: SEQUENTIALLY
378           projects:
379             - name: 'apex-deploy-baremetal-{scenario_stream}'
380               node-parameters: true
381               current-parameters: true
382               predefined-parameters: |
383                 OPNFV_CLEAN=yes
384                 GERRIT_BRANCH=$GERRIT_BRANCH
385                 GERRIT_REFSPEC=
386                 DEPLOY_SCENARIO=$DEPLOY_SCENARIO
387               kill-phase-on: NEVER
388               abort-all-job: true
389               git-revision: false
390             - name: 'apex-fetch-logs-{scenario_stream}'
391               current-parameters: true
392               predefined-parameters: |
393                 GERRIT_BRANCH=$GERRIT_BRANCH
394                 GERRIT_REFSPEC=
395               node-parameters: true
396               kill-phase-on: NEVER
397               abort-all-job: true
398               git-revision: false
399       - multijob:
400           name: 'OPNFV Test Suite'
401           condition: ALWAYS
402           projects:
403             - name: 'apex-testsuite-{scenario}-baremetal-{scenario_stream}'
404               node-parameters: true
405               current-parameters: false
406               predefined-parameters:
407                 DEPLOY_SCENARIO=$DEPLOY_SCENARIO
408               kill-phase-on: NEVER
409               abort-all-job: true
410               git-revision: false
411       - multijob:
412           name: apex-fetch-logs
413           projects:
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     publishers:
424       - groovy-postbuild:
425           script:
426             !include-raw-escape: ./update-build-result.groovy
427
428 # Baremetal test job
429 - job-template:
430     name: 'apex-testsuite-{scenario}-baremetal-{scenario_stream}'
431
432     project-type: 'multijob'
433
434     disabled: false
435
436     parameters:
437       - '{project}-defaults'
438       - '{project}-baremetal-{scenario_stream}-defaults'
439       - project-parameter:
440           project: '{project}'
441           branch: '{branch}'
442       - apex-parameter:
443           gs-pathname: '{gs-pathname}'
444       - string:
445           name: DEPLOY_SCENARIO
446           default: '{scenario}'
447           description: "Scenario to deploy with."
448
449     properties:
450       - logrotate-default
451       - build-blocker:
452           use-build-blocker: true
453           block-level: 'NODE'
454           blocking-jobs:
455             - 'apex-verify.*'
456             - 'apex-runner.*'
457             - 'apex-.*-promote.*'
458             - 'apex-run.*'
459             - 'apex-testsuite-.+-baremetal-.+'
460       - throttle:
461           max-per-node: 1
462           max-total: 10
463           option: 'project'
464
465     builders:
466       - description-setter:
467           description: "Testing on $NODE_NAME - Scenario: $DEPLOY_SCENARIO"
468       - multijob:
469           name: Functest
470           condition: ALWAYS
471           projects:
472             - name: 'functest-apex-baremetal-daily-{scenario_stream}'
473               node-parameters: true
474               current-parameters: false
475               predefined-parameters:
476                 DEPLOY_SCENARIO=$DEPLOY_SCENARIO
477               kill-phase-on: NEVER
478               abort-all-job: false
479               git-revision: false
480       - multijob:
481           name: Yardstick
482           condition: ALWAYS
483           projects:
484             - name: 'yardstick-apex-baremetal-daily-{scenario_stream}'
485               node-parameters: true
486               current-parameters: false
487               predefined-parameters:
488                 DEPLOY_SCENARIO=$DEPLOY_SCENARIO
489               kill-phase-on: NEVER
490               abort-all-job: false
491               git-revision: false
492       - multijob:
493           name: Dovetail-proposed_tests
494           condition: ALWAYS
495           projects:
496             - name: 'dovetail-apex-baremetal-proposed_tests-{scenario_stream}'
497               node-parameters: true
498               current-parameters: false
499               predefined-parameters:
500                 DEPLOY_SCENARIO=$DEPLOY_SCENARIO
501               kill-phase-on: NEVER
502               enable-condition: "def m = '$DEPLOY_SCENARIO' ==~ /os-(nosdn-nofeature|odl-bgpvpn)-ha/
503                                  && $BUILD_NUMBER % 2 == 1"
504               abort-all-job: false
505               git-revision: false
506       - multijob:
507           name: Dovetail-default
508           condition: ALWAYS
509           projects:
510             - name: 'dovetail-apex-baremetal-default-{scenario_stream}'
511               node-parameters: true
512               current-parameters: false
513               predefined-parameters:
514                 DEPLOY_SCENARIO=$DEPLOY_SCENARIO
515               kill-phase-on: NEVER
516               enable-condition: "def m = '$DEPLOY_SCENARIO' ==~ /os-(nosdn-nofeature|odl-bgpvpn)-ha/
517                                  && $BUILD_NUMBER % 2 == 0"
518               abort-all-job: false
519               git-revision: false
520       - multijob:
521           name: StorPerf
522           condition: ALWAYS
523           projects:
524             - name: 'storperf-apex-baremetal-daily-{scenario_stream}'
525               node-parameters: true
526               current-parameters: false
527               predefined-parameters:
528                 DEPLOY_SCENARIO=$DEPLOY_SCENARIO
529               enable-condition: "def m = '$DEPLOY_SCENARIO' ==~ /os-nosdn-nofeature-ha/"
530               kill-phase-on: NEVER
531               abort-all-job: false
532               git-revision: false
533 # Build status is always success due conditional plugin prefetching
534 # build status before multijob phases execute
535 #        - conditional-step:
536 #            condition-kind: current-status
537 #            condition-worst: SUCCESS
538 #            condtion-best: SUCCESS
539 #            on-evaluation-failure: mark-unstable
540 #            steps:
541 #                - shell: 'echo "Tests Passed"'
542
543 - job-template:
544     name: 'apex-daily-{stream}'
545
546     # Job template for daily build
547     #
548     # Required Variables:
549     #     stream:    branch with - in place of / (eg. stable)
550     #     branch:    branch (eg. stable)
551     project-type: 'multijob'
552
553     disabled: '{obj:disable_daily}'
554
555     scm:
556       - git-scm
557
558     parameters:
559       - '{project}-defaults'
560       - '{project}-baremetal-{stream}-defaults'
561       - project-parameter:
562           project: '{project}'
563           branch: '{branch}'
564       - apex-parameter:
565           gs-pathname: '{gs-pathname}'
566
567     properties:
568       - logrotate-default
569       - build-blocker:
570           use-build-blocker: true
571           block-level: 'NODE'
572           blocking-jobs:
573             - 'apex-daily.*'
574
575     triggers:
576       - 'apex-{stream}'
577
578     builders:
579       - multijob:
580           name: build
581           condition: SUCCESSFUL
582           projects:
583             - name: 'apex-build-{stream}'
584               current-parameters: false
585               predefined-parameters: |
586                 GERRIT_BRANCH=$GERRIT_BRANCH
587                 GERRIT_REFSPEC=
588                 GERRIT_CHANGE_NUMBER=$GERRIT_CHANGE_NUMBER
589                 GERRIT_CHANGE_COMMIT_MESSAGE=$GERRIT_CHANGE_COMMIT_MESSAGE
590               node-parameters: true
591               kill-phase-on: FAILURE
592               abort-all-job: true
593               git-revision: true
594       - multijob:
595           name: 'Verify and upload ISO'
596           condition: SUCCESSFUL
597           projects:
598             - name: 'apex-verify-iso-{stream}'
599               current-parameters: false
600               predefined-parameters: |
601                 BUILD_DIRECTORY=$WORKSPACE/../apex-build-{stream}/.build
602                 GERRIT_BRANCH=$GERRIT_BRANCH
603                 GERRIT_REFSPEC=
604                 GERRIT_CHANGE_NUMBER=$GERRIT_CHANGE_NUMBER
605                 GERRIT_CHANGE_COMMIT_MESSAGE=$GERRIT_CHANGE_COMMIT_MESSAGE
606               node-parameters: true
607               kill-phase-on: FAILURE
608               abort-all-job: true
609               git-revision: true
610       - apex-builder-{stream}
611
612 # snapshot create
613 - job-template:
614     name: 'apex-create-snapshot'
615
616     # Job template for clean
617     #
618     # Required Variables:
619     #     stream:    branch with - in place of / (eg. stable)
620
621     disabled: false
622
623     builders:
624       - shell:
625           !include-raw-escape: ./apex-snapshot-create.sh
626
627 # snapshot upload
628 - job-template:
629     name: 'apex-upload-snapshot'
630
631     # Job template for clean
632     #
633     # Required Variables:
634     #     stream:    branch with - in place of / (eg. stable)
635
636     disabled: false
637
638     builders:
639       - inject:
640           properties-content: ARTIFACT_TYPE=snapshot
641       - 'apex-upload-artifact'
642
643 # CSIT promote
644 - job-template:
645     name: 'apex-csit-promote-daily-{stream}'
646
647     # Job template for promoting CSIT Snapshots
648     #
649     # Required Variables:
650     #     stream:    branch with - in place of / (eg. stable)
651     #     branch:    branch (eg. stable)
652     node: '{virtual-slave}'
653     project-type: 'multijob'
654     disabled: '{disable_promote}'
655
656     scm:
657       - git-scm
658
659     parameters:
660       - project-parameter:
661           project: '{project}'
662           branch: '{branch}'
663       - apex-parameter:
664           gs-pathname: '{gs-pathname}'
665
666     properties:
667       - build-blocker:
668           use-build-blocker: true
669           block-level: 'NODE'
670           blocking-jobs:
671             - 'apex-verify.*'
672             - 'apex-deploy.*'
673             - 'apex-runner.*'
674             - 'apex-daily.*'
675
676     triggers:
677       - timed: '0 12 * * 0'
678
679     builders:
680       - multijob:
681           name: deploy-virtual
682           condition: SUCCESSFUL
683           projects:
684             - name: 'apex-deploy-virtual-{stream}'
685               current-parameters: false
686               predefined-parameters: |
687                 DEPLOY_SCENARIO=os-odl-{os_version}_upstream-noha
688                 OPNFV_CLEAN=yes
689                 GERRIT_BRANCH=$GERRIT_BRANCH
690                 GERRIT_REFSPEC=$GERRIT_REFSPEC
691                 GERRIT_CHANGE_NUMBER=$GERRIT_CHANGE_NUMBER
692                 GERRIT_CHANGE_COMMIT_MESSAGE=$GERRIT_CHANGE_COMMIT_MESSAGE
693                 PROMOTE=True
694               node-parameters: true
695               kill-phase-on: FAILURE
696               abort-all-job: true
697               git-revision: false
698       - multijob:
699           name: functest-smoke
700           condition: SUCCESSFUL
701           projects:
702             - name: 'functest-apex-virtual-suite-{stream}'
703               current-parameters: false
704               predefined-parameters: |
705                 DEPLOY_SCENARIO=os-odl-{os_version}_upstream-noha
706                 FUNCTEST_SUITE_NAME=tempest_smoke_serial
707                 GERRIT_BRANCH=$GERRIT_BRANCH
708                 GERRIT_REFSPEC=$GERRIT_REFSPEC
709                 GERRIT_CHANGE_NUMBER=$GERRIT_CHANGE_NUMBER
710                 GERRIT_CHANGE_COMMIT_MESSAGE=$GERRIT_CHANGE_COMMIT_MESSAGE
711               node-parameters: true
712               kill-phase-on: FAILURE
713               abort-all-job: true
714               git-revision: false
715       - multijob:
716           name: create snapshot
717           condition: SUCCESSFUL
718           projects:
719             - name: 'apex-create-snapshot'
720               current-parameters: false
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: false
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