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