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