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