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