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