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