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