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