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