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