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