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