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