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