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