Merge "Update Global-jjb to master"
[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       - shell: |
325           if echo $DEPLOY_SCENARIO | grep queens &> /dev/null; then
326           echo 'REPO=opnfv' > functest_repo
327           else
328           echo 'REPO=ollivier' > functest_repo
329           fi
330       - inject:
331           properties-file: functest_repo
332       - multijob:
333           name: functest-smoke
334           condition: ALWAYS
335           projects:
336             - name: 'functest-apex-virtual-suite-{stream}'
337               current-parameters: false
338               predefined-parameters: |
339                 DEPLOY_SCENARIO=$DEPLOY_SCENARIO
340                 FUNCTEST_MODE=$FUNCTEST_MODE
341                 FUNCTEST_SUITE_NAME=$FUNCTEST_SUITE_NAME
342                 REPO=$REPO
343                 GERRIT_BRANCH=$GERRIT_BRANCH
344                 GERRIT_REFSPEC=$GERRIT_REFSPEC
345                 GERRIT_CHANGE_NUMBER=$GERRIT_CHANGE_NUMBER
346                 GERRIT_CHANGE_COMMIT_MESSAGE=$GERRIT_CHANGE_COMMIT_MESSAGE
347               node-parameters: true
348               kill-phase-on: NEVER
349               abort-all-job: true
350               git-revision: false
351       - multijob:
352           name: apex-fetch-logs
353           projects:
354             - name: 'apex-fetch-logs-{stream}'
355               current-parameters: false
356               predefined-parameters: |
357                 GERRIT_BRANCH=$GERRIT_BRANCH
358                 GERRIT_REFSPEC=$GERRIT_REFSPEC
359                 GERRIT_CHANGE_NUMBER=$GERRIT_CHANGE_NUMBER
360                 GERRIT_CHANGE_COMMIT_MESSAGE=$GERRIT_CHANGE_COMMIT_MESSAGE
361               node-parameters: true
362               kill-phase-on: NEVER
363               abort-all-job: true
364               git-revision: false
365
366 # Baremetal Deploy and Test
367 - job-template:
368     name: 'apex-{scenario}-baremetal-{scenario_stream}'
369
370     project-type: 'multijob'
371
372     disabled: false
373
374     scm:
375       - git-scm
376
377     parameters:
378       - '{project}-defaults'
379       - '{project}-baremetal-{scenario_stream}-defaults'
380       - project-parameter:
381           project: '{project}'
382           branch: '{branch}'
383       - apex-parameter:
384           gs-pathname: '{gs-pathname}'
385       - string:
386           name: DEPLOY_SCENARIO
387           default: '{scenario}'
388           description: "Scenario to deploy with."
389
390     properties:
391       - logrotate-default
392       - build-blocker:
393           use-build-blocker: true
394           blocking-level: 'NODE'
395           blocking-jobs:
396             - 'apex-verify.*'
397             - 'apex-runner.*'
398             - 'apex-.*-promote.*'
399             - 'apex-run.*'
400             - 'apex-.+-baremetal-.+'
401       - throttle:
402           max-per-node: 1
403           max-total: 10
404           option: 'project'
405
406     builders:
407       - description-setter:
408           description: "Deployed on $NODE_NAME - Scenario: $DEPLOY_SCENARIO"
409       - multijob:
410           name: 'Baremetal Deploy'
411           condition: SUCCESSFUL
412           execution-type: SEQUENTIALLY
413           projects:
414             - name: 'apex-deploy-baremetal-{scenario_stream}'
415               node-parameters: true
416               current-parameters: true
417               predefined-parameters: |
418                 OPNFV_CLEAN=yes
419                 GERRIT_BRANCH=$GERRIT_BRANCH
420                 GERRIT_REFSPEC=
421                 DEPLOY_SCENARIO=$DEPLOY_SCENARIO
422               kill-phase-on: NEVER
423               abort-all-job: true
424               git-revision: false
425             - name: 'apex-fetch-logs-{scenario_stream}'
426               current-parameters: true
427               predefined-parameters: |
428                 GERRIT_BRANCH=$GERRIT_BRANCH
429                 GERRIT_REFSPEC=
430               node-parameters: true
431               kill-phase-on: NEVER
432               abort-all-job: true
433               git-revision: false
434       - shell: |
435           if echo $DEPLOY_SCENARIO | grep queens &> /dev/null; then
436             echo 'REPO=opnfv' > functest_properties
437           else
438             echo 'REPO=ollivier' > functest_properties
439           fi
440           features=$(echo $DEPLOY_SCENARIO | sed -r -n 's/os-.+-(.+)-(noha|ha)/\1/p')
441           if [ "$features" == 'queens' ]; then
442             functest_scenario=$(echo $DEPLOY_SCENARIO | sed -r -n 's/(os-.+?)-queens-(noha|ha)/\1-nofeature-\2/p')
443           elif [[ "$features" =~ 'queens' ]]; then
444             functest_scenario=$(echo $DEPLOY_SCENARIO | sed -r -n 's/(os-.+?)-(.+)_queens-(noha|ha)/\1-\2-\3/p')
445           else
446             functest_scenario=$DEPLOY_SCENARIO
447           fi
448           echo "DEPLOY_SCENARIO=$functest_scenario" >> functest_properties
449       - inject:
450           properties-file: functest_properties
451           override-build-parameters: true
452       - multijob:
453           name: 'OPNFV Test Suite'
454           condition: ALWAYS
455           projects:
456             - name: 'apex-testsuite-{scenario}-baremetal-{scenario_stream}'
457               node-parameters: true
458               current-parameters: false
459               predefined-parameters:
460                 DEPLOY_SCENARIO=$DEPLOY_SCENARIO
461               kill-phase-on: NEVER
462               abort-all-job: true
463               git-revision: false
464       - multijob:
465           name: apex-fetch-logs
466           projects:
467             - name: 'apex-fetch-logs-{scenario_stream}'
468               current-parameters: true
469               predefined-parameters: |
470                 GERRIT_BRANCH=$GERRIT_BRANCH
471                 GERRIT_REFSPEC=
472               node-parameters: true
473               kill-phase-on: NEVER
474               abort-all-job: true
475               git-revision: false
476     publishers:
477       - groovy-postbuild:
478           script:
479             !include-raw-escape: ./update-build-result.groovy
480
481 # Baremetal test job
482 - job-template:
483     name: 'apex-testsuite-{scenario}-baremetal-{scenario_stream}'
484
485     project-type: 'multijob'
486
487     disabled: false
488
489     parameters:
490       - '{project}-defaults'
491       - '{project}-baremetal-{scenario_stream}-defaults'
492       - project-parameter:
493           project: '{project}'
494           branch: '{branch}'
495       - apex-parameter:
496           gs-pathname: '{gs-pathname}'
497       - string:
498           name: DEPLOY_SCENARIO
499           default: '{scenario}'
500           description: "Scenario to deploy with."
501
502     properties:
503       - logrotate-default
504       - build-blocker:
505           use-build-blocker: true
506           blocking-level: 'NODE'
507           blocking-jobs:
508             - 'apex-verify.*'
509             - 'apex-runner.*'
510             - 'apex-run.*'
511             - 'apex-testsuite-.+-baremetal-.+'
512       - throttle:
513           max-per-node: 1
514           max-total: 10
515           option: 'project'
516
517     builders:
518       - description-setter:
519           description: "Testing on $NODE_NAME - Scenario: $DEPLOY_SCENARIO"
520       - multijob:
521           name: Functest
522           condition: ALWAYS
523           projects:
524             - name: 'functest-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: Yardstick
534           condition: ALWAYS
535           projects:
536             - name: 'yardstick-apex-baremetal-daily-{scenario_stream}'
537               node-parameters: true
538               current-parameters: false
539               predefined-parameters:
540                 DEPLOY_SCENARIO=$DEPLOY_SCENARIO
541               kill-phase-on: NEVER
542               abort-all-job: false
543               git-revision: false
544       - multijob:
545           name: Dovetail-proposed_tests
546           condition: ALWAYS
547           projects:
548             - name: 'dovetail-apex-baremetal-default-mandatory-{scenario_stream}'
549               node-parameters: true
550               current-parameters: false
551               predefined-parameters:
552                 DEPLOY_SCENARIO=$DEPLOY_SCENARIO
553               kill-phase-on: NEVER
554               enable-condition: "def m = '$DEPLOY_SCENARIO' ==~ /os-(nosdn-nofeature|odl-bgpvpn)-ha/"
555               abort-all-job: false
556               git-revision: false
557       - multijob:
558           name: Dovetail-default
559           condition: ALWAYS
560           projects:
561             - name: 'dovetail-apex-baremetal-default-optional-{scenario_stream}'
562               node-parameters: true
563               current-parameters: false
564               predefined-parameters:
565                 DEPLOY_SCENARIO=$DEPLOY_SCENARIO
566               kill-phase-on: NEVER
567               enable-condition: "def m = '$DEPLOY_SCENARIO' ==~ /os-(nosdn-nofeature|odl-bgpvpn)-ha/"
568               abort-all-job: false
569               git-revision: false
570       - multijob:
571           name: StorPerf
572           condition: ALWAYS
573           projects:
574             - name: 'storperf-apex-baremetal-daily-{scenario_stream}'
575               node-parameters: true
576               current-parameters: false
577               predefined-parameters:
578                 DEPLOY_SCENARIO=$DEPLOY_SCENARIO
579               enable-condition: "def m = '$DEPLOY_SCENARIO' ==~ /os-nosdn-nofeature-ha/"
580               kill-phase-on: NEVER
581               abort-all-job: false
582               git-revision: false
583 # Build status is always success due conditional plugin prefetching
584 # build status before multijob phases execute
585 #        - conditional-step:
586 #            condition-kind: current-status
587 #            condition-worst: SUCCESS
588 #            condtion-best: SUCCESS
589 #            on-evaluation-failure: mark-unstable
590 #            steps:
591 #                - shell: 'echo "Tests Passed"'
592
593 - job-template:
594     name: 'apex-daily-{stream}'
595
596     # Job template for daily build
597     #
598     # Required Variables:
599     #     stream:    branch with - in place of / (eg. stable)
600     #     branch:    branch (eg. stable)
601     project-type: 'multijob'
602
603     disabled: '{obj:disable_daily}'
604
605     scm:
606       - git-scm
607
608     parameters:
609       - '{project}-defaults'
610       - '{project}-baremetal-{stream}-defaults'
611       - project-parameter:
612           project: '{project}'
613           branch: '{branch}'
614       - apex-parameter:
615           gs-pathname: '{gs-pathname}'
616
617     properties:
618       - logrotate-default
619       - build-blocker:
620           use-build-blocker: true
621           blocking-level: 'NODE'
622           blocking-jobs:
623             - 'apex-daily.*'
624
625     triggers:
626       - 'apex-{stream}'
627
628     builders:
629       - multijob:
630           name: build
631           condition: SUCCESSFUL
632           projects:
633             - name: 'apex-build-{stream}'
634               current-parameters: false
635               predefined-parameters: |
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       - multijob:
645           name: 'Verify and upload ISO'
646           condition: SUCCESSFUL
647           projects:
648             - name: 'apex-verify-iso-{stream}'
649               current-parameters: false
650               predefined-parameters: |
651                 BUILD_DIRECTORY=$WORKSPACE/../apex-build-{stream}/.build
652                 GERRIT_BRANCH=$GERRIT_BRANCH
653                 GERRIT_REFSPEC=
654                 GERRIT_CHANGE_NUMBER=$GERRIT_CHANGE_NUMBER
655                 GERRIT_CHANGE_COMMIT_MESSAGE=$GERRIT_CHANGE_COMMIT_MESSAGE
656               node-parameters: true
657               kill-phase-on: FAILURE
658               abort-all-job: true
659               git-revision: true
660       - apex-builder-{stream}
661
662 # snapshot info fetch
663 - job-template:
664     name: 'apex-fetch-snap-info'
665
666     disabled: false
667
668     parameters:
669       - '{project}-defaults'
670
671     builders:
672       - shell:
673           !include-raw-escape: ./apex-fetch-snap-info.sh
674
675 # snapshot create
676 - job-template:
677     name: 'apex-create-snapshot'
678
679     disabled: false
680
681     parameters:
682       - '{project}-defaults'
683
684     builders:
685       - shell:
686           !include-raw-escape: ./apex-snapshot-create.sh
687
688 # snapshot upload
689 - job-template:
690     name: 'apex-upload-snapshot'
691
692     disabled: false
693
694     parameters:
695       - '{project}-defaults'
696
697     builders:
698       - inject:
699           properties-content: ARTIFACT_TYPE=snapshot
700       - 'apex-upload-artifact'
701
702 # CSIT promote
703 - job-template:
704     name: 'apex-csit-promote-daily-{stream}-os-{os_version}-{topology}'
705
706     # Job template for promoting CSIT Snapshots
707     #
708     # Required Variables:
709     #     stream:    branch with - in place of / (eg. stable)
710     #     branch:    branch (eg. stable)
711     node: '{virtual-slave}'
712     project-type: 'multijob'
713     disabled: '{disable_promote}'
714
715     scm:
716       - git-scm
717
718     parameters:
719       - project-parameter:
720           project: '{project}'
721           branch: '{branch}'
722       - apex-parameter:
723           gs-pathname: '{gs-pathname}'
724       - string:
725           name: ARTIFACT_VERSION
726           default: dev
727           description: "Used for overriding the ARTIFACT_VERSION"
728       - string:
729           name: PROMOTE
730           default: 'True'
731           description: "Used for overriding the PROMOTE"
732       - string:
733           name: GS_URL
734           default: $GS_BASE{gs-pathname}/{os_version}/{topology}
735           description: "User for overriding GS_URL from apex params"
736       - string:
737           name: OS_VERSION
738           default: '{os_version}'
739           description: OpenStack version short name
740       - string:
741           name: ODL_BRANCH
742           default: '{odl_branch}'
743           description: ODL branch being used
744       - string:
745           name: FORCE_PROMOTE
746           default: 'False'
747           description: "Used to force promotion and skip CSIT"
748     properties:
749       - build-blocker:
750           use-build-blocker: true
751           blocking-level: 'NODE'
752           blocking-jobs:
753             - 'apex-verify.*'
754             - 'apex-runner.*'
755             - 'apex-daily.*'
756             - 'apex-csit-promote.*'
757             - 'odl-netvirt.*'
758       - throttle:
759           max-per-node: 1
760           max-total: 10
761           option: 'project'
762
763     triggers:
764       - '{stream}-{os_version}'
765
766     builders:
767       - multijob:
768           name: apex-virtual-deploy
769           condition: SUCCESSFUL
770           projects:
771             - name: 'apex-deploy-virtual-{stream}'
772               current-parameters: true
773               predefined-parameters: |
774                 DEPLOY_SCENARIO=os-odl-{os_scenario}-{topology}
775                 OPNFV_CLEAN=yes
776                 GERRIT_BRANCH=$GERRIT_BRANCH
777                 GERRIT_REFSPEC=$GERRIT_REFSPEC
778                 GERRIT_CHANGE_NUMBER=$GERRIT_CHANGE_NUMBER
779                 GERRIT_CHANGE_COMMIT_MESSAGE=$GERRIT_CHANGE_COMMIT_MESSAGE
780               node-parameters: true
781               kill-phase-on: FAILURE
782               abort-all-job: true
783               git-revision: true
784       - multijob:
785           name: fetch snapshot info
786           condition: SUCCESSFUL
787           projects:
788             - name: 'apex-fetch-snap-info'
789               current-parameters: true
790               node-parameters: true
791               kill-phase-on: FAILURE
792               abort-all-job: true
793               git-revision: false
794       - multijob:
795           name: csit
796           condition: SUCCESSFUL
797           execution-type: SEQUENTIALLY
798           projects:
799             - name: cperf-apex-csit-master
800               predefined-parameters: |
801                 ODL_BRANCH=$ODL_BRANCH
802                 RC_FILE_PATH=/tmp/csit/overcloudrc
803                 NODE_FILE_PATH=/tmp/csit/node.yaml
804                 SSH_KEY_PATH=/tmp/csit/id_rsa
805                 ODL_CONTAINERIZED=true
806                 OS_VERSION=$OS_VERSION
807                 SKIP_CSIT=$FORCE_PROMOTE
808               node-parameters: true
809               kill-phase-on: NEVER
810               abort-all-job: false
811             - name: cperf-upload-logs-csit
812               predefined-parameters: |
813                 ODL_BRANCH=$ODL_BRANCH
814                 OS_VERSION=$OS_VERSION
815               node-parameters: true
816               kill-phase-on: FAILURE
817               abort-all-job: false
818             - name: 'apex-fetch-logs-{stream}'
819               current-parameters: false
820               predefined-parameters: |
821                 GERRIT_BRANCH=$GERRIT_BRANCH
822                 GERRIT_REFSPEC=$GERRIT_REFSPEC
823                 GERRIT_CHANGE_NUMBER=$GERRIT_CHANGE_NUMBER
824                 GERRIT_CHANGE_COMMIT_MESSAGE=$GERRIT_CHANGE_COMMIT_MESSAGE
825               node-parameters: true
826               kill-phase-on: NEVER
827               abort-all-job: true
828               git-revision: false
829       - multijob:
830           name: create snapshot
831           condition: SUCCESSFUL
832           projects:
833             - name: 'apex-create-snapshot'
834               current-parameters: true
835               predefined-parameters: |
836                 SNAP_TYPE=csit
837               node-parameters: true
838               kill-phase-on: FAILURE
839               abort-all-job: true
840               git-revision: false
841       - multijob:
842           name: upload snapshot
843           condition: SUCCESSFUL
844           projects:
845             - name: 'apex-upload-snapshot'
846               current-parameters: true
847               predefined-parameters: |
848                 SNAP_TYPE=csit
849               node-parameters: true
850               kill-phase-on: FAILURE
851               abort-all-job: true
852               git-revision: false
853
854 # FDIO promote
855 - job-template:
856     name: 'apex-fdio-promote-daily-{stream}'
857
858     # Job template for promoting CSIT Snapshots
859     #
860     # Required Variables:
861     #     stream:    branch with - in place of / (eg. stable)
862     #     branch:    branch (eg. stable)
863     node: '{virtual-slave}'
864     project-type: 'multijob'
865     disabled: false
866
867     scm:
868       - git-scm
869
870     parameters:
871       - project-parameter:
872           project: '{project}'
873           branch: '{branch}'
874       - apex-parameter:
875           gs-pathname: '{gs-pathname}'
876
877     properties:
878       - build-blocker:
879           use-build-blocker: true
880           blocking-level: 'NODE'
881           blocking-jobs:
882             - 'apex-verify.*'
883             - 'apex-deploy.*'
884             - 'apex-runner.*'
885             - 'apex-daily.*'
886
887     builders:
888       - multijob:
889           name: build
890           condition: SUCCESSFUL
891           projects:
892             - name: 'apex-build-{stream}'
893               current-parameters: false
894               predefined-parameters: |
895                 GERRIT_BRANCH=$GERRIT_BRANCH
896                 GERRIT_REFSPEC=$GERRIT_REFSPEC
897                 GERRIT_CHANGE_NUMBER=$GERRIT_CHANGE_NUMBER
898                 GERRIT_CHANGE_COMMIT_MESSAGE=$GERRIT_CHANGE_COMMIT_MESSAGE
899               node-parameters: false
900               kill-phase-on: FAILURE
901               abort-all-job: true
902               git-revision: true
903       - multijob:
904           name: deploy-virtual
905           condition: SUCCESSFUL
906           projects:
907             - name: 'apex-deploy-virtual-{stream}'
908               current-parameters: false
909               predefined-parameters: |
910                 DEPLOY_SCENARIO=os-odl_netvirt-fdio-noha
911                 OPNFV_CLEAN=yes
912                 GERRIT_BRANCH=$GERRIT_BRANCH
913                 GERRIT_REFSPEC=$GERRIT_REFSPEC
914                 GERRIT_CHANGE_NUMBER=$GERRIT_CHANGE_NUMBER
915                 GERRIT_CHANGE_COMMIT_MESSAGE=$GERRIT_CHANGE_COMMIT_MESSAGE
916                 PROMOTE=True
917               node-parameters: true
918               kill-phase-on: FAILURE
919               abort-all-job: true
920               git-revision: false
921       - multijob:
922           name: create snapshot
923           condition: SUCCESSFUL
924           projects:
925             - name: 'apex-create-snapshot'
926               current-parameters: false
927               predefined-parameters: |
928                 SNAP_TYPE=fdio
929               node-parameters: true
930               kill-phase-on: FAILURE
931               abort-all-job: true
932               git-revision: false
933       - multijob:
934           name: upload snapshot
935           condition: SUCCESSFUL
936           projects:
937             - name: 'apex-upload-snapshot'
938               current-parameters: false
939               predefined-parameters: |
940                 SNAP_TYPE=fdio
941               node-parameters: true
942               kill-phase-on: FAILURE
943               abort-all-job: true
944               git-revision: false
945
946 # Flex job
947 - job-template:
948     name: 'apex-flex-daily-os-nosdn-nofeature-ha-{stream}'
949
950     project-type: 'multijob'
951
952     disabled: false
953
954     node: 'flex-pod2'
955
956     scm:
957       - git-scm
958
959     triggers:
960       - 'apex-{stream}'
961
962     parameters:
963       - '{project}-defaults'
964       - project-parameter:
965           project: '{project}'
966           branch: '{branch}'
967       - apex-parameter:
968           gs-pathname: '{gs-pathname}'
969       - string:
970           name: DEPLOY_SCENARIO
971           default: 'os-nosdn-nofeature-ha'
972           description: "Scenario to deploy with."
973       - string:
974           name: GIT_BASE
975           default: https://gerrit.opnfv.org/gerrit/$PROJECT
976           description: 'Git URL to use on this Jenkins Slave'
977       - string:
978           name: SSH_KEY
979           default: /root/.ssh/id_rsa
980           description: 'SSH key to use for Apex'
981
982     properties:
983       - logrotate-default
984       - build-blocker:
985           use-build-blocker: true
986           blocking-level: 'NODE'
987           blocking-jobs:
988             - 'apex-verify.*'
989             - 'apex-runner.*'
990             - 'apex-.*-promote.*'
991             - 'apex-run.*'
992             - 'apex-.+-baremetal-.+'
993       - throttle:
994           max-per-node: 1
995           max-total: 10
996           option: 'project'
997
998     builders:
999       - description-setter:
1000           description: "Deployed on $NODE_NAME - Scenario: $DEPLOY_SCENARIO"
1001       - multijob:
1002           name: 'Baremetal Deploy'
1003           condition: SUCCESSFUL
1004           projects:
1005             - name: 'apex-deploy-baremetal-{stream}'
1006               node-parameters: true
1007               current-parameters: true
1008               predefined-parameters: |
1009                 OPNFV_CLEAN=yes
1010                 GERRIT_BRANCH=$GERRIT_BRANCH
1011                 GERRIT_REFSPEC=
1012                 DEPLOY_SCENARIO=$DEPLOY_SCENARIO
1013               kill-phase-on: FAILURE
1014               abort-all-job: true
1015               git-revision: false
1016       - multijob:
1017           name: Yardstick
1018           condition: ALWAYS
1019           projects:
1020             - name: 'yardstick-apex-baremetal-daily-{stream}'
1021               node-parameters: true
1022               current-parameters: false
1023               predefined-parameters:
1024                 DEPLOY_SCENARIO=$DEPLOY_SCENARIO
1025               kill-phase-on: NEVER
1026               abort-all-job: false
1027               git-revision: false
1028
1029 # Dovetail Danube test job
1030 - job-template:
1031     name: 'apex-dovetail-daily-os-nosdn-nofeature-ha-baremetal-danube'
1032
1033     project-type: 'multijob'
1034
1035     node: 'huawei-pod4'
1036
1037     disabled: false
1038
1039     parameters:
1040       - '{project}-defaults'
1041       - project-parameter:
1042           project: '{project}'
1043           branch: 'stable/danube'
1044       - apex-parameter:
1045           gs-pathname: '/danube'
1046       - string:
1047           name: DEPLOY_SCENARIO
1048           default: 'os-nosdn-nofeature-ha'
1049           description: "Scenario to deploy with."
1050
1051     properties:
1052       - logrotate-default
1053       - build-blocker:
1054           use-build-blocker: true
1055           blocking-level: 'NODE'
1056           blocking-jobs:
1057             - 'apex-verify.*'
1058             - 'apex-runner.*'
1059             - 'apex-.*-promote.*'
1060             - 'apex-run.*'
1061
1062     triggers:
1063       - timed: ''  # '0 1 * * *'
1064
1065     builders:
1066       - description-setter:
1067           description: "Testing on $NODE_NAME - Scenario: $DEPLOY_SCENARIO"
1068       - multijob:
1069           name: 'Baremetal Deploy'
1070           condition: SUCCESSFUL
1071           projects:
1072             - name: 'apex-deploy-baremetal-danube'
1073               node-parameters: true
1074               current-parameters: true
1075               predefined-parameters: |
1076                 OPNFV_CLEAN=yes
1077                 GERRIT_BRANCH=$GERRIT_BRANCH
1078                 GERRIT_REFSPEC=
1079                 DEPLOY_SCENARIO=$DEPLOY_SCENARIO
1080               kill-phase-on: FAILURE
1081               abort-all-job: true
1082               git-revision: false
1083       - multijob:
1084           name: Dovetail
1085           condition: ALWAYS
1086           projects:
1087             - name: 'dovetail-apex-baremetal-proposed_tests-danube'
1088               node-parameters: true
1089               current-parameters: false
1090               predefined-parameters:
1091                 DEPLOY_SCENARIO=$DEPLOY_SCENARIO
1092               kill-phase-on: NEVER
1093               abort-all-job: false
1094               git-revision: false
1095
1096 ########################
1097 # parameter macros
1098 ########################
1099 - parameter:
1100     name: apex-parameter
1101     parameters:
1102       - string:
1103           name: ARTIFACT_NAME
1104           default: 'latest'
1105           description: "RPM Artifact name that will be appended to GS_URL to deploy a specific artifact"
1106       - string:
1107           name: ARTIFACT_VERSION
1108           default: 'daily'
1109           description: "Artifact version type"
1110       - string:
1111           name: BUILD_DIRECTORY
1112           default: $WORKSPACE/.build
1113           description: "Directory where the build artifact will be located upon the completion of the build."
1114       - string:
1115           name: CACHE_DIRECTORY
1116           default: $HOME/opnfv/apex-cache{gs-pathname}
1117           description: "Directory where the cache to be used during the build is located."
1118       # yamllint disable rule:line-length
1119       - string:
1120           name: GIT_BASE
1121           default: https://gerrit.opnfv.org/gerrit/$PROJECT
1122           description: "Used for overriding the GIT URL coming from Global Jenkins configuration in case if the stuff is done on none-LF HW."
1123       # yamllint enable rule:line-length
1124       - string:
1125           name: GS_PATHNAME
1126           default: '{gs-pathname}'
1127           description: "Version directory where opnfv artifacts are stored in gs repository"
1128       - string:
1129           name: GS_URL
1130           default: $GS_BASE{gs-pathname}
1131           description: "URL to Google Storage."
1132       - string:
1133           name: PROMOTE
1134           default: 'False'
1135           description: "Flag to know if we should promote/upload snapshot artifacts."
1136
1137 ########################
1138 # builder macros
1139 ########################
1140 {% for stream in scenarios %}
1141 # {{ stream }} Builder
1142 - builder:
1143     name: apex-builder-{{ stream }}
1144     builders:
1145       - multijob:
1146           name: Baremetal Deploy and Test Phase
1147           condition: SUCCESSFUL
1148           projects:
1149 {%- for scenario in scenarios[stream] %}
1150             - name: 'apex-{{ scenario }}-baremetal-{{ stream }}'
1151               node-parameters: false
1152               current-parameters: false
1153               predefined-parameters: |
1154                 OPNFV_CLEAN=yes
1155               kill-phase-on: NEVER
1156               abort-all-job: true
1157               git-revision: false
1158 {%- endfor %}
1159 {% endfor -%}
1160
1161 - builder:
1162     name: 'apex-upload-artifact'
1163     builders:
1164       - shell:
1165           !include-raw: ./apex-upload-artifact.sh
1166
1167 - builder:
1168     name: 'apex-download-artifact'
1169     builders:
1170       - shell:
1171           !include-raw: ./apex-download-artifact.sh
1172
1173 - builder:
1174     name: 'apex-deploy'
1175     builders:
1176       - shell:
1177           !include-raw: ./apex-deploy.sh
1178
1179 - builder:
1180     name: 'apex-fetch-logs'
1181     builders:
1182       - shell:
1183           !include-raw: ./apex-fetch-logs.sh
1184
1185 #######################
1186 # trigger macros
1187 # timed is in format: 'min hour daymonth month dayweek'
1188 ########################
1189 - trigger:
1190     name: 'apex-master'
1191     triggers:
1192       - timed: '0 0 1-31/2 * *'
1193
1194 - trigger:
1195     name: 'apex-gambia'
1196     triggers:
1197       - timed: '0 4 2-30/2 * *'
1198
1199 - trigger:
1200     name: 'apex-fraser'
1201     triggers:
1202       - timed: '0 0 2-30/2 * *'
1203
1204 - trigger:
1205     name: 'apex-euphrates'
1206     triggers:
1207       - timed: '0 0 2-30/2 * *'
1208
1209 - trigger:
1210     name: 'apex-danube'
1211     triggers:
1212       - timed: '0 3 1 1 7'
1213
1214 - trigger:
1215     name: 'master-master'
1216     triggers:
1217       - timed: '0 12 * * *'
1218
1219 - trigger:
1220     name: 'master-rocky'
1221     triggers:
1222       - timed: '0 12 * * *'
1223
1224 - trigger:
1225     name: 'master-queens'
1226     triggers:
1227       - timed: ''
1228
1229 - trigger:
1230     name: 'gambia-master'
1231     triggers:
1232       - timed: ''
1233
1234 - trigger:
1235     name: 'gambia-rocky'
1236     triggers:
1237       - timed: ''
1238
1239 - trigger:
1240     name: 'gambia-queens'
1241     triggers:
1242       - timed: '0 12 * * *'
1243
1244 - trigger:
1245     name: 'fraser-master'
1246     triggers:
1247       - timed: ''
1248
1249 - trigger:
1250     name: 'fraser-rocky'
1251     triggers:
1252       - timed: ''
1253
1254 - trigger:
1255     name: 'fraser-queens'
1256     triggers:
1257       - timed: ''
1258
1259 - trigger:
1260     name: 'euphrates-master'
1261     triggers:
1262       - timed: ''
1263
1264 - trigger:
1265     name: 'euphrates-rocky'
1266     triggers:
1267       - timed: ''
1268
1269 - trigger:
1270     name: 'euphrates-queens'
1271     triggers:
1272       - timed: ''
1273
1274 - trigger:
1275     name: 'danube-master'
1276     triggers:
1277       - timed: ''
1278
1279 - trigger:
1280     name: 'danube-rocky'
1281     triggers:
1282       - timed: ''
1283
1284 - trigger:
1285     name: 'danube-queens'
1286     triggers:
1287       - timed: ''