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