5965efece187480add684d9f5ee765a710c03b1c
[releng.git] / jjb / apex / apex.yml.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}'
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-odl-nofeature-ha'
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-odl-nofeature-ha'
39           scenario_stream: 'fraser'
40           disable_daily: false
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       - 'queens'
79       - 'master'
80
81
82 # Fetch Logs Job
83 - job-template:
84     name: 'apex-fetch-logs-{stream}'
85
86     concurrent: true
87
88     disabled: false
89     scm:
90       - git-scm-gerrit
91     parameters:
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: ALWAYS
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           projects:
319             - name: 'apex-fetch-logs-{stream}'
320               current-parameters: false
321               predefined-parameters: |
322                 GERRIT_BRANCH=$GERRIT_BRANCH
323                 GERRIT_REFSPEC=$GERRIT_REFSPEC
324                 GERRIT_CHANGE_NUMBER=$GERRIT_CHANGE_NUMBER
325                 GERRIT_CHANGE_COMMIT_MESSAGE=$GERRIT_CHANGE_COMMIT_MESSAGE
326               node-parameters: true
327               kill-phase-on: NEVER
328               abort-all-job: true
329               git-revision: false
330
331 # Baremetal Deploy and Test
332 - job-template:
333     name: 'apex-{scenario}-baremetal-{scenario_stream}'
334
335     project-type: 'multijob'
336
337     disabled: false
338
339     scm:
340       - git-scm
341
342     parameters:
343       - '{project}-defaults'
344       - '{project}-baremetal-{scenario_stream}-defaults'
345       - project-parameter:
346           project: '{project}'
347           branch: '{branch}'
348       - apex-parameter:
349           gs-pathname: '{gs-pathname}'
350       - string:
351           name: DEPLOY_SCENARIO
352           default: '{scenario}'
353           description: "Scenario to deploy with."
354
355     properties:
356       - logrotate-default
357       - build-blocker:
358           use-build-blocker: true
359           block-level: 'NODE'
360           blocking-jobs:
361             - 'apex-verify.*'
362             - 'apex-runner.*'
363             - 'apex-.*-promote.*'
364             - 'apex-run.*'
365             - 'apex-.+-baremetal-.+'
366       - throttle:
367           max-per-node: 1
368           max-total: 10
369           option: 'project'
370
371     builders:
372       - description-setter:
373           description: "Deployed on $NODE_NAME - Scenario: $DEPLOY_SCENARIO"
374       - multijob:
375           name: 'Baremetal Deploy'
376           condition: SUCCESSFUL
377           projects:
378             - name: 'apex-deploy-baremetal-{scenario_stream}'
379               node-parameters: true
380               current-parameters: true
381               predefined-parameters: |
382                 OPNFV_CLEAN=yes
383                 GERRIT_BRANCH=$GERRIT_BRANCH
384                 GERRIT_REFSPEC=
385                 DEPLOY_SCENARIO=$DEPLOY_SCENARIO
386               kill-phase-on: FAILURE
387               abort-all-job: true
388               git-revision: false
389       - multijob:
390           name: 'OPNFV Test Suite'
391           condition: ALWAYS
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           projects:
404             - name: 'apex-fetch-logs'
405               current-parameters: true
406               predefined-parameters: |
407                 GERRIT_BRANCH=$GERRIT_BRANCH
408                 GERRIT_REFSPEC=
409               node-parameters: true
410               kill-phase-on: NEVER
411               abort-all-job: true
412               git-revision: false
413     publishers:
414       - groovy-postbuild:
415           script:
416             !include-raw-escape: ./update-build-result.groovy
417
418 # Baremetal test job
419 - job-template:
420     name: 'apex-testsuite-{scenario}-baremetal-{scenario_stream}'
421
422     project-type: 'multijob'
423
424     disabled: false
425
426     parameters:
427       - '{project}-defaults'
428       - '{project}-baremetal-{scenario_stream}-defaults'
429       - project-parameter:
430           project: '{project}'
431           branch: '{branch}'
432       - apex-parameter:
433           gs-pathname: '{gs-pathname}'
434       - string:
435           name: DEPLOY_SCENARIO
436           default: '{scenario}'
437           description: "Scenario to deploy with."
438
439     properties:
440       - logrotate-default
441       - build-blocker:
442           use-build-blocker: true
443           block-level: 'NODE'
444           blocking-jobs:
445             - 'apex-verify.*'
446             - 'apex-runner.*'
447             - 'apex-.*-promote.*'
448             - 'apex-run.*'
449             - 'apex-testsuite-.+-baremetal-.+'
450       - throttle:
451           max-per-node: 1
452           max-total: 10
453           option: 'project'
454
455     builders:
456       - description-setter:
457           description: "Testing on $NODE_NAME - Scenario: $DEPLOY_SCENARIO"
458       - multijob:
459           name: Functest
460           condition: ALWAYS
461           projects:
462             - name: 'functest-apex-baremetal-daily-{scenario_stream}'
463               node-parameters: true
464               current-parameters: false
465               predefined-parameters:
466                 DEPLOY_SCENARIO=$DEPLOY_SCENARIO
467               kill-phase-on: NEVER
468               abort-all-job: false
469               git-revision: false
470       - multijob:
471           name: Yardstick
472           condition: ALWAYS
473           projects:
474             - name: 'yardstick-apex-baremetal-daily-{scenario_stream}'
475               node-parameters: true
476               current-parameters: false
477               predefined-parameters:
478                 DEPLOY_SCENARIO=$DEPLOY_SCENARIO
479               kill-phase-on: NEVER
480               abort-all-job: false
481               git-revision: false
482       - multijob:
483           name: Dovetail-proposed_tests
484           condition: ALWAYS
485           projects:
486             - name: 'dovetail-apex-baremetal-proposed_tests-{scenario_stream}'
487               node-parameters: true
488               current-parameters: false
489               predefined-parameters:
490                 DEPLOY_SCENARIO=$DEPLOY_SCENARIO
491               kill-phase-on: NEVER
492               enable-condition: "def m = '$DEPLOY_SCENARIO' ==~ /os-(nosdn-nofeature|odl-bgpvpn)-ha/
493                                  && $BUILD_NUMBER % 2 == 1"
494               abort-all-job: false
495               git-revision: false
496       - multijob:
497           name: Dovetail-default
498           condition: ALWAYS
499           projects:
500             - name: 'dovetail-apex-baremetal-default-{scenario_stream}'
501               node-parameters: true
502               current-parameters: false
503               predefined-parameters:
504                 DEPLOY_SCENARIO=$DEPLOY_SCENARIO
505               kill-phase-on: NEVER
506               enable-condition: "def m = '$DEPLOY_SCENARIO' ==~ /os-(nosdn-nofeature|odl-bgpvpn)-ha/
507                                  && $BUILD_NUMBER % 2 == 0"
508               abort-all-job: false
509               git-revision: false
510       - multijob:
511           name: StorPerf
512           condition: ALWAYS
513           projects:
514             - name: 'storperf-apex-baremetal-daily-{scenario_stream}'
515               node-parameters: true
516               current-parameters: false
517               predefined-parameters:
518                 DEPLOY_SCENARIO=$DEPLOY_SCENARIO
519               enable-condition: "def m = '$DEPLOY_SCENARIO' ==~ /os-nosdn-nofeature-ha/"
520               kill-phase-on: NEVER
521               abort-all-job: false
522               git-revision: false
523 # Build status is always success due conditional plugin prefetching
524 # build status before multijob phases execute
525 #        - conditional-step:
526 #            condition-kind: current-status
527 #            condition-worst: SUCCESS
528 #            condtion-best: SUCCESS
529 #            on-evaluation-failure: mark-unstable
530 #            steps:
531 #                - shell: 'echo "Tests Passed"'
532
533 - job-template:
534     name: 'apex-daily-{stream}'
535
536     # Job template for daily build
537     #
538     # Required Variables:
539     #     stream:    branch with - in place of / (eg. stable)
540     #     branch:    branch (eg. stable)
541     project-type: 'multijob'
542
543     disabled: '{obj:disable_daily}'
544
545     scm:
546       - git-scm
547
548     parameters:
549       - '{project}-defaults'
550       - '{project}-baremetal-{stream}-defaults'
551       - project-parameter:
552           project: '{project}'
553           branch: '{branch}'
554       - apex-parameter:
555           gs-pathname: '{gs-pathname}'
556
557     properties:
558       - logrotate-default
559       - build-blocker:
560           use-build-blocker: true
561           block-level: 'NODE'
562           blocking-jobs:
563             - 'apex-daily.*'
564
565     triggers:
566       - 'apex-{stream}'
567
568     builders:
569       - multijob:
570           name: build
571           condition: SUCCESSFUL
572           projects:
573             - name: 'apex-build-{stream}'
574               current-parameters: false
575               predefined-parameters: |
576                 GERRIT_BRANCH=$GERRIT_BRANCH
577                 GERRIT_REFSPEC=
578                 GERRIT_CHANGE_NUMBER=$GERRIT_CHANGE_NUMBER
579                 GERRIT_CHANGE_COMMIT_MESSAGE=$GERRIT_CHANGE_COMMIT_MESSAGE
580               node-parameters: true
581               kill-phase-on: FAILURE
582               abort-all-job: true
583               git-revision: true
584       - multijob:
585           name: 'Verify and upload ISO'
586           condition: SUCCESSFUL
587           projects:
588             - name: 'apex-verify-iso-{stream}'
589               current-parameters: false
590               predefined-parameters: |
591                 BUILD_DIRECTORY=$WORKSPACE/../apex-build-{stream}/.build
592                 GERRIT_BRANCH=$GERRIT_BRANCH
593                 GERRIT_REFSPEC=
594                 GERRIT_CHANGE_NUMBER=$GERRIT_CHANGE_NUMBER
595                 GERRIT_CHANGE_COMMIT_MESSAGE=$GERRIT_CHANGE_COMMIT_MESSAGE
596               node-parameters: true
597               kill-phase-on: FAILURE
598               abort-all-job: true
599               git-revision: true
600       - apex-builder-{stream}
601
602 # snapshot create
603 - job-template:
604     name: 'apex-create-snapshot'
605
606     # Job template for clean
607     #
608     # Required Variables:
609     #     stream:    branch with - in place of / (eg. stable)
610
611     disabled: false
612
613     builders:
614       - shell:
615           !include-raw-escape: ./apex-snapshot-create.sh
616
617 # snapshot upload
618 - job-template:
619     name: 'apex-upload-snapshot'
620
621     # Job template for clean
622     #
623     # Required Variables:
624     #     stream:    branch with - in place of / (eg. stable)
625
626     disabled: false
627
628     builders:
629       - inject:
630           properties-content: ARTIFACT_TYPE=snapshot
631       - 'apex-upload-artifact'
632
633 # CSIT promote
634 - job-template:
635     name: 'apex-csit-promote-daily-{stream}'
636
637     # Job template for promoting CSIT Snapshots
638     #
639     # Required Variables:
640     #     stream:    branch with - in place of / (eg. stable)
641     #     branch:    branch (eg. stable)
642     node: '{virtual-slave}'
643     project-type: 'multijob'
644     disabled: '{disable_promote}'
645
646     scm:
647       - git-scm
648
649     parameters:
650       - project-parameter:
651           project: '{project}'
652           branch: '{branch}'
653       - apex-parameter:
654           gs-pathname: '{gs-pathname}'
655
656     properties:
657       - build-blocker:
658           use-build-blocker: true
659           block-level: 'NODE'
660           blocking-jobs:
661             - 'apex-verify.*'
662             - 'apex-deploy.*'
663             - 'apex-runner.*'
664             - 'apex-daily.*'
665
666     triggers:
667       - timed: '0 12 * * 0'
668
669     builders:
670       - multijob:
671           name: deploy-virtual
672           condition: SUCCESSFUL
673           projects:
674             - name: 'apex-deploy-virtual-{stream}'
675               current-parameters: false
676               predefined-parameters: |
677                 DEPLOY_SCENARIO=os-odl-{os_version}_upstream-noha
678                 OPNFV_CLEAN=yes
679                 GERRIT_BRANCH=$GERRIT_BRANCH
680                 GERRIT_REFSPEC=$GERRIT_REFSPEC
681                 GERRIT_CHANGE_NUMBER=$GERRIT_CHANGE_NUMBER
682                 GERRIT_CHANGE_COMMIT_MESSAGE=$GERRIT_CHANGE_COMMIT_MESSAGE
683                 PROMOTE=True
684               node-parameters: true
685               kill-phase-on: FAILURE
686               abort-all-job: true
687               git-revision: false
688       - multijob:
689           name: functest-smoke
690           condition: SUCCESSFUL
691           projects:
692             - name: 'functest-apex-virtual-suite-{stream}'
693               current-parameters: false
694               predefined-parameters: |
695                 DEPLOY_SCENARIO=os-odl-{os_version}_upstream-noha
696                 FUNCTEST_SUITE_NAME=tempest_smoke_serial
697                 GERRIT_BRANCH=$GERRIT_BRANCH
698                 GERRIT_REFSPEC=$GERRIT_REFSPEC
699                 GERRIT_CHANGE_NUMBER=$GERRIT_CHANGE_NUMBER
700                 GERRIT_CHANGE_COMMIT_MESSAGE=$GERRIT_CHANGE_COMMIT_MESSAGE
701               node-parameters: true
702               kill-phase-on: FAILURE
703               abort-all-job: true
704               git-revision: false
705       - multijob:
706           name: create snapshot
707           condition: SUCCESSFUL
708           projects:
709             - name: 'apex-create-snapshot'
710               current-parameters: false
711               predefined-parameters: |
712                 SNAP_TYPE=csit
713               node-parameters: true
714               kill-phase-on: FAILURE
715               abort-all-job: true
716               git-revision: false
717       - multijob:
718           name: upload snapshot
719           condition: SUCCESSFUL
720           projects:
721             - name: 'apex-upload-snapshot'
722               current-parameters: false
723               predefined-parameters: |
724                 SNAP_TYPE=csit
725               node-parameters: true
726               kill-phase-on: FAILURE
727               abort-all-job: true
728               git-revision: false
729
730 # FDIO promote
731 - job-template:
732     name: 'apex-fdio-promote-daily-{stream}'
733
734     # Job template for promoting CSIT Snapshots
735     #
736     # Required Variables:
737     #     stream:    branch with - in place of / (eg. stable)
738     #     branch:    branch (eg. stable)
739     node: '{virtual-slave}'
740     project-type: 'multijob'
741     disabled: false
742
743     scm:
744       - git-scm
745
746     parameters:
747       - project-parameter:
748           project: '{project}'
749           branch: '{branch}'
750       - apex-parameter:
751           gs-pathname: '{gs-pathname}'
752
753     properties:
754       - build-blocker:
755           use-build-blocker: true
756           block-level: 'NODE'
757           blocking-jobs:
758             - 'apex-verify.*'
759             - 'apex-deploy.*'
760             - 'apex-runner.*'
761             - 'apex-daily.*'
762
763     builders:
764       - multijob:
765           name: build
766           condition: SUCCESSFUL
767           projects:
768             - name: 'apex-build-{stream}'
769               current-parameters: false
770               predefined-parameters: |
771                 GERRIT_BRANCH=$GERRIT_BRANCH
772                 GERRIT_REFSPEC=$GERRIT_REFSPEC
773                 GERRIT_CHANGE_NUMBER=$GERRIT_CHANGE_NUMBER
774                 GERRIT_CHANGE_COMMIT_MESSAGE=$GERRIT_CHANGE_COMMIT_MESSAGE
775               node-parameters: false
776               kill-phase-on: FAILURE
777               abort-all-job: true
778               git-revision: true
779       - multijob:
780           name: deploy-virtual
781           condition: SUCCESSFUL
782           projects:
783             - name: 'apex-deploy-virtual-{stream}'
784               current-parameters: false
785               predefined-parameters: |
786                 DEPLOY_SCENARIO=os-odl_netvirt-fdio-noha
787                 OPNFV_CLEAN=yes
788                 GERRIT_BRANCH=$GERRIT_BRANCH
789                 GERRIT_REFSPEC=$GERRIT_REFSPEC
790                 GERRIT_CHANGE_NUMBER=$GERRIT_CHANGE_NUMBER
791                 GERRIT_CHANGE_COMMIT_MESSAGE=$GERRIT_CHANGE_COMMIT_MESSAGE
792                 PROMOTE=True
793               node-parameters: true
794               kill-phase-on: FAILURE
795               abort-all-job: true
796               git-revision: false
797       - multijob:
798           name: create snapshot
799           condition: SUCCESSFUL
800           projects:
801             - name: 'apex-create-snapshot'
802               current-parameters: false
803               predefined-parameters: |
804                 SNAP_TYPE=fdio
805               node-parameters: true
806               kill-phase-on: FAILURE
807               abort-all-job: true
808               git-revision: false
809       - multijob:
810           name: upload snapshot
811           condition: SUCCESSFUL
812           projects:
813             - name: 'apex-upload-snapshot'
814               current-parameters: false
815               predefined-parameters: |
816                 SNAP_TYPE=fdio
817               node-parameters: true
818               kill-phase-on: FAILURE
819               abort-all-job: true
820               git-revision: false
821
822 # Flex job
823 - job-template:
824     name: 'apex-flex-daily-os-nosdn-nofeature-ha-{stream}'
825
826     project-type: 'multijob'
827
828     disabled: false
829
830     node: 'flex-pod2'
831
832     scm:
833       - git-scm
834
835     triggers:
836       - 'apex-{stream}'
837
838     parameters:
839       - '{project}-defaults'
840       - project-parameter:
841           project: '{project}'
842           branch: '{branch}'
843       - apex-parameter:
844           gs-pathname: '{gs-pathname}'
845       - string:
846           name: DEPLOY_SCENARIO
847           default: 'os-nosdn-nofeature-ha'
848           description: "Scenario to deploy with."
849       - string:
850           name: GIT_BASE
851           default: https://gerrit.opnfv.org/gerrit/$PROJECT
852           description: 'Git URL to use on this Jenkins Slave'
853       - string:
854           name: SSH_KEY
855           default: /root/.ssh/id_rsa
856           description: 'SSH key to use for Apex'
857
858     properties:
859       - logrotate-default
860       - build-blocker:
861           use-build-blocker: true
862           block-level: 'NODE'
863           blocking-jobs:
864             - 'apex-verify.*'
865             - 'apex-runner.*'
866             - 'apex-.*-promote.*'
867             - 'apex-run.*'
868             - 'apex-.+-baremetal-.+'
869       - throttle:
870           max-per-node: 1
871           max-total: 10
872           option: 'project'
873
874     builders:
875       - description-setter:
876           description: "Deployed on $NODE_NAME - Scenario: $DEPLOY_SCENARIO"
877       - multijob:
878           name: 'Baremetal Deploy'
879           condition: SUCCESSFUL
880           projects:
881             - name: 'apex-deploy-baremetal-{stream}'
882               node-parameters: true
883               current-parameters: true
884               predefined-parameters: |
885                 OPNFV_CLEAN=yes
886                 GERRIT_BRANCH=$GERRIT_BRANCH
887                 GERRIT_REFSPEC=
888                 DEPLOY_SCENARIO=$DEPLOY_SCENARIO
889               kill-phase-on: FAILURE
890               abort-all-job: true
891               git-revision: false
892       - multijob:
893           name: Yardstick
894           condition: ALWAYS
895           projects:
896             - name: 'yardstick-apex-baremetal-daily-{stream}'
897               node-parameters: true
898               current-parameters: false
899               predefined-parameters:
900                 DEPLOY_SCENARIO=$DEPLOY_SCENARIO
901               kill-phase-on: NEVER
902               abort-all-job: false
903               git-revision: false
904
905 # Dovetail Danube test job
906 - job-template:
907     name: 'apex-dovetail-daily-os-nosdn-nofeature-ha-baremetal-danube'
908
909     project-type: 'multijob'
910
911     node: 'huawei-pod4'
912
913     disabled: false
914
915     parameters:
916       - '{project}-defaults'
917       - project-parameter:
918           project: '{project}'
919           branch: 'stable/danube'
920       - apex-parameter:
921           gs-pathname: '/danube'
922       - string:
923           name: DEPLOY_SCENARIO
924           default: 'os-nosdn-nofeature-ha'
925           description: "Scenario to deploy with."
926
927     properties:
928       - logrotate-default
929       - build-blocker:
930           use-build-blocker: true
931           block-level: 'NODE'
932           blocking-jobs:
933             - 'apex-verify.*'
934             - 'apex-runner.*'
935             - 'apex-.*-promote.*'
936             - 'apex-run.*'
937
938     triggers:
939       - timed: ''  # '0 1 * * *'
940
941     builders:
942       - description-setter:
943           description: "Testing on $NODE_NAME - Scenario: $DEPLOY_SCENARIO"
944       - multijob:
945           name: 'Baremetal Deploy'
946           condition: SUCCESSFUL
947           projects:
948             - name: 'apex-deploy-baremetal-danube'
949               node-parameters: true
950               current-parameters: true
951               predefined-parameters: |
952                 OPNFV_CLEAN=yes
953                 GERRIT_BRANCH=$GERRIT_BRANCH
954                 GERRIT_REFSPEC=
955                 DEPLOY_SCENARIO=$DEPLOY_SCENARIO
956               kill-phase-on: FAILURE
957               abort-all-job: true
958               git-revision: false
959       - multijob:
960           name: Dovetail
961           condition: ALWAYS
962           projects:
963             - name: 'dovetail-apex-baremetal-proposed_tests-danube'
964               node-parameters: true
965               current-parameters: false
966               predefined-parameters:
967                 DEPLOY_SCENARIO=$DEPLOY_SCENARIO
968               kill-phase-on: NEVER
969               abort-all-job: false
970               git-revision: false
971
972 ########################
973 # parameter macros
974 ########################
975 - parameter:
976     name: apex-parameter
977     parameters:
978       - string:
979           name: ARTIFACT_NAME
980           default: 'latest'
981           description: "RPM Artifact name that will be appended to GS_URL to deploy a specific artifact"
982       - string:
983           name: ARTIFACT_VERSION
984           default: 'daily'
985           description: "Artifact version type"
986       - string:
987           name: BUILD_DIRECTORY
988           default: $WORKSPACE/.build
989           description: "Directory where the build artifact will be located upon the completion of the build."
990       - string:
991           name: CACHE_DIRECTORY
992           default: $HOME/opnfv/apex-cache{gs-pathname}
993           description: "Directory where the cache to be used during the build is located."
994       # yamllint disable rule:line-length
995       - string:
996           name: GIT_BASE
997           default: https://gerrit.opnfv.org/gerrit/$PROJECT
998           description: "Used for overriding the GIT URL coming from Global Jenkins configuration in case if the stuff is done on none-LF HW."
999       # yamllint enable rule:line-length
1000       - string:
1001           name: GS_PATHNAME
1002           default: '{gs-pathname}'
1003           description: "Version directory where opnfv artifacts are stored in gs repository"
1004       - string:
1005           name: GS_URL
1006           default: $GS_BASE{gs-pathname}
1007           description: "URL to Google Storage."
1008       - string:
1009           name: PROMOTE
1010           default: 'False'
1011           description: "Flag to know if we should promote/upload snapshot artifacts."
1012
1013 ########################
1014 # builder macros
1015 ########################
1016 {% for stream in scenarios %}
1017 # {{ stream }} Builder
1018 - builder:
1019     name: apex-builder-{{ stream }}
1020     builders:
1021       - multijob:
1022           name: Baremetal Deploy and Test Phase
1023           condition: SUCCESSFUL
1024           projects:
1025 {%- for scenario in scenarios[stream] %}
1026             - name: 'apex-{{ scenario }}-baremetal-{{ stream }}'
1027               node-parameters: false
1028               current-parameters: false
1029               predefined-parameters: |
1030                 OPNFV_CLEAN=yes
1031               kill-phase-on: NEVER
1032               abort-all-job: true
1033               git-revision: false
1034 {%- endfor %}
1035 {% endfor -%}
1036
1037 - builder:
1038     name: 'apex-upload-artifact'
1039     builders:
1040       - shell:
1041           !include-raw: ./apex-upload-artifact.sh
1042
1043 - builder:
1044     name: 'apex-download-artifact'
1045     builders:
1046       - shell:
1047           !include-raw: ./apex-download-artifact.sh
1048
1049 - builder:
1050     name: 'apex-deploy'
1051     builders:
1052       - shell:
1053           !include-raw: ./apex-deploy.sh
1054
1055 - builder:
1056     name: 'apex-fetch-logs'
1057     builders:
1058       - shell:
1059           !include-raw: ./apex-fetch-logs.sh
1060
1061 #######################
1062 # trigger macros
1063 ########################
1064 - trigger:
1065     name: 'apex-master'
1066     triggers:
1067       - timed: '0 0 1-31/2 * *'
1068
1069 - trigger:
1070     name: 'apex-fraser'
1071     triggers:
1072       - timed: '0 0 2-30/2 * *'
1073
1074 - trigger:
1075     name: 'apex-euphrates'
1076     triggers:
1077       - timed: '0 0 2-30/2 * *'
1078
1079 - trigger:
1080     name: 'apex-danube'
1081     triggers:
1082       - timed: '0 3 1 1 7'
1083