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