Merge "Update the repo script to only list repos once"
[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-{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     disabled: false
628
629     parameters:
630       - '{project}-defaults'
631
632     builders:
633       - shell:
634           !include-raw-escape: ./apex-snapshot-create.sh
635
636 # snapshot upload
637 - job-template:
638     name: 'apex-upload-snapshot'
639
640     disabled: false
641
642     parameters:
643       - '{project}-defaults'
644
645     builders:
646       - inject:
647           properties-content: ARTIFACT_TYPE=snapshot
648       - 'apex-upload-artifact'
649
650 # CSIT promote
651 - job-template:
652     name: 'apex-csit-promote-daily-{stream}-os-{os_version}'
653
654     # Job template for promoting CSIT Snapshots
655     #
656     # Required Variables:
657     #     stream:    branch with - in place of / (eg. stable)
658     #     branch:    branch (eg. stable)
659     node: '{virtual-slave}'
660     project-type: 'multijob'
661     disabled: '{disable_promote}'
662
663     scm:
664       - git-scm
665
666     parameters:
667       - project-parameter:
668           project: '{project}'
669           branch: '{branch}'
670       - apex-parameter:
671           gs-pathname: '{gs-pathname}'
672       - string:
673           name: ARTIFACT_VERSION
674           default: dev
675           description: "Used for overriding the ARTIFACT_VERSION"
676       - string:
677           name: PROMOTE
678           default: 'True'
679           description: "Used for overriding the PROMOTE"
680
681     properties:
682       - build-blocker:
683           use-build-blocker: true
684           block-level: 'NODE'
685           blocking-jobs:
686             - 'apex-verify.*'
687             - 'apex-runner.*'
688             - 'apex-daily.*'
689
690     triggers:
691       - timed: '0 12 * * 0'
692
693     builders:
694       - multijob:
695           name: apex-virtual-deploy-test
696           condition: SUCCESSFUL
697           projects:
698             - name: 'apex-virtual-{stream}'
699               current-parameters: true
700               predefined-parameters: |
701                 DEPLOY_SCENARIO=os-odl-{os_scenario}-noha
702                 OPNFV_CLEAN=yes
703                 GERRIT_BRANCH=$GERRIT_BRANCH
704                 GERRIT_REFSPEC=$GERRIT_REFSPEC
705                 GERRIT_CHANGE_NUMBER=$GERRIT_CHANGE_NUMBER
706                 GERRIT_CHANGE_COMMIT_MESSAGE=$GERRIT_CHANGE_COMMIT_MESSAGE
707                 FUNCTEST_SUITE_NAME=tempest_smoke_serial
708                 FUNCTEST_MODE=testcase
709               node-parameters: true
710               kill-phase-on: FAILURE
711               abort-all-job: true
712               git-revision: true
713       - multijob:
714           name: create snapshot
715           condition: SUCCESSFUL
716           projects:
717             - name: 'apex-create-snapshot'
718               current-parameters: true
719               predefined-parameters: |
720                 SNAP_TYPE=csit
721               node-parameters: true
722               kill-phase-on: FAILURE
723               abort-all-job: true
724               git-revision: false
725       - multijob:
726           name: upload snapshot
727           condition: SUCCESSFUL
728           projects:
729             - name: 'apex-upload-snapshot'
730               current-parameters: true
731               predefined-parameters: |
732                 SNAP_TYPE=csit
733               node-parameters: true
734               kill-phase-on: FAILURE
735               abort-all-job: true
736               git-revision: false
737
738 # FDIO promote
739 - job-template:
740     name: 'apex-fdio-promote-daily-{stream}'
741
742     # Job template for promoting CSIT Snapshots
743     #
744     # Required Variables:
745     #     stream:    branch with - in place of / (eg. stable)
746     #     branch:    branch (eg. stable)
747     node: '{virtual-slave}'
748     project-type: 'multijob'
749     disabled: false
750
751     scm:
752       - git-scm
753
754     parameters:
755       - project-parameter:
756           project: '{project}'
757           branch: '{branch}'
758       - apex-parameter:
759           gs-pathname: '{gs-pathname}'
760
761     properties:
762       - build-blocker:
763           use-build-blocker: true
764           block-level: 'NODE'
765           blocking-jobs:
766             - 'apex-verify.*'
767             - 'apex-deploy.*'
768             - 'apex-runner.*'
769             - 'apex-daily.*'
770
771     builders:
772       - multijob:
773           name: build
774           condition: SUCCESSFUL
775           projects:
776             - name: 'apex-build-{stream}'
777               current-parameters: false
778               predefined-parameters: |
779                 GERRIT_BRANCH=$GERRIT_BRANCH
780                 GERRIT_REFSPEC=$GERRIT_REFSPEC
781                 GERRIT_CHANGE_NUMBER=$GERRIT_CHANGE_NUMBER
782                 GERRIT_CHANGE_COMMIT_MESSAGE=$GERRIT_CHANGE_COMMIT_MESSAGE
783               node-parameters: false
784               kill-phase-on: FAILURE
785               abort-all-job: true
786               git-revision: true
787       - multijob:
788           name: deploy-virtual
789           condition: SUCCESSFUL
790           projects:
791             - name: 'apex-deploy-virtual-{stream}'
792               current-parameters: false
793               predefined-parameters: |
794                 DEPLOY_SCENARIO=os-odl_netvirt-fdio-noha
795                 OPNFV_CLEAN=yes
796                 GERRIT_BRANCH=$GERRIT_BRANCH
797                 GERRIT_REFSPEC=$GERRIT_REFSPEC
798                 GERRIT_CHANGE_NUMBER=$GERRIT_CHANGE_NUMBER
799                 GERRIT_CHANGE_COMMIT_MESSAGE=$GERRIT_CHANGE_COMMIT_MESSAGE
800                 PROMOTE=True
801               node-parameters: true
802               kill-phase-on: FAILURE
803               abort-all-job: true
804               git-revision: false
805       - multijob:
806           name: create snapshot
807           condition: SUCCESSFUL
808           projects:
809             - name: 'apex-create-snapshot'
810               current-parameters: false
811               predefined-parameters: |
812                 SNAP_TYPE=fdio
813               node-parameters: true
814               kill-phase-on: FAILURE
815               abort-all-job: true
816               git-revision: false
817       - multijob:
818           name: upload snapshot
819           condition: SUCCESSFUL
820           projects:
821             - name: 'apex-upload-snapshot'
822               current-parameters: false
823               predefined-parameters: |
824                 SNAP_TYPE=fdio
825               node-parameters: true
826               kill-phase-on: FAILURE
827               abort-all-job: true
828               git-revision: false
829
830 # Flex job
831 - job-template:
832     name: 'apex-flex-daily-os-nosdn-nofeature-ha-{stream}'
833
834     project-type: 'multijob'
835
836     disabled: false
837
838     node: 'flex-pod2'
839
840     scm:
841       - git-scm
842
843     triggers:
844       - 'apex-{stream}'
845
846     parameters:
847       - '{project}-defaults'
848       - project-parameter:
849           project: '{project}'
850           branch: '{branch}'
851       - apex-parameter:
852           gs-pathname: '{gs-pathname}'
853       - string:
854           name: DEPLOY_SCENARIO
855           default: 'os-nosdn-nofeature-ha'
856           description: "Scenario to deploy with."
857       - string:
858           name: GIT_BASE
859           default: https://gerrit.opnfv.org/gerrit/$PROJECT
860           description: 'Git URL to use on this Jenkins Slave'
861       - string:
862           name: SSH_KEY
863           default: /root/.ssh/id_rsa
864           description: 'SSH key to use for Apex'
865
866     properties:
867       - logrotate-default
868       - build-blocker:
869           use-build-blocker: true
870           block-level: 'NODE'
871           blocking-jobs:
872             - 'apex-verify.*'
873             - 'apex-runner.*'
874             - 'apex-.*-promote.*'
875             - 'apex-run.*'
876             - 'apex-.+-baremetal-.+'
877       - throttle:
878           max-per-node: 1
879           max-total: 10
880           option: 'project'
881
882     builders:
883       - description-setter:
884           description: "Deployed on $NODE_NAME - Scenario: $DEPLOY_SCENARIO"
885       - multijob:
886           name: 'Baremetal Deploy'
887           condition: SUCCESSFUL
888           projects:
889             - name: 'apex-deploy-baremetal-{stream}'
890               node-parameters: true
891               current-parameters: true
892               predefined-parameters: |
893                 OPNFV_CLEAN=yes
894                 GERRIT_BRANCH=$GERRIT_BRANCH
895                 GERRIT_REFSPEC=
896                 DEPLOY_SCENARIO=$DEPLOY_SCENARIO
897               kill-phase-on: FAILURE
898               abort-all-job: true
899               git-revision: false
900       - multijob:
901           name: Yardstick
902           condition: ALWAYS
903           projects:
904             - name: 'yardstick-apex-baremetal-daily-{stream}'
905               node-parameters: true
906               current-parameters: false
907               predefined-parameters:
908                 DEPLOY_SCENARIO=$DEPLOY_SCENARIO
909               kill-phase-on: NEVER
910               abort-all-job: false
911               git-revision: false
912
913 # Dovetail Danube test job
914 - job-template:
915     name: 'apex-dovetail-daily-os-nosdn-nofeature-ha-baremetal-danube'
916
917     project-type: 'multijob'
918
919     node: 'huawei-pod4'
920
921     disabled: false
922
923     parameters:
924       - '{project}-defaults'
925       - project-parameter:
926           project: '{project}'
927           branch: 'stable/danube'
928       - apex-parameter:
929           gs-pathname: '/danube'
930       - string:
931           name: DEPLOY_SCENARIO
932           default: 'os-nosdn-nofeature-ha'
933           description: "Scenario to deploy with."
934
935     properties:
936       - logrotate-default
937       - build-blocker:
938           use-build-blocker: true
939           block-level: 'NODE'
940           blocking-jobs:
941             - 'apex-verify.*'
942             - 'apex-runner.*'
943             - 'apex-.*-promote.*'
944             - 'apex-run.*'
945
946     triggers:
947       - timed: ''  # '0 1 * * *'
948
949     builders:
950       - description-setter:
951           description: "Testing on $NODE_NAME - Scenario: $DEPLOY_SCENARIO"
952       - multijob:
953           name: 'Baremetal Deploy'
954           condition: SUCCESSFUL
955           projects:
956             - name: 'apex-deploy-baremetal-danube'
957               node-parameters: true
958               current-parameters: true
959               predefined-parameters: |
960                 OPNFV_CLEAN=yes
961                 GERRIT_BRANCH=$GERRIT_BRANCH
962                 GERRIT_REFSPEC=
963                 DEPLOY_SCENARIO=$DEPLOY_SCENARIO
964               kill-phase-on: FAILURE
965               abort-all-job: true
966               git-revision: false
967       - multijob:
968           name: Dovetail
969           condition: ALWAYS
970           projects:
971             - name: 'dovetail-apex-baremetal-proposed_tests-danube'
972               node-parameters: true
973               current-parameters: false
974               predefined-parameters:
975                 DEPLOY_SCENARIO=$DEPLOY_SCENARIO
976               kill-phase-on: NEVER
977               abort-all-job: false
978               git-revision: false
979
980 ########################
981 # parameter macros
982 ########################
983 - parameter:
984     name: apex-parameter
985     parameters:
986       - string:
987           name: ARTIFACT_NAME
988           default: 'latest'
989           description: "RPM Artifact name that will be appended to GS_URL to deploy a specific artifact"
990       - string:
991           name: ARTIFACT_VERSION
992           default: 'daily'
993           description: "Artifact version type"
994       - string:
995           name: BUILD_DIRECTORY
996           default: $WORKSPACE/.build
997           description: "Directory where the build artifact will be located upon the completion of the build."
998       - string:
999           name: CACHE_DIRECTORY
1000           default: $HOME/opnfv/apex-cache{gs-pathname}
1001           description: "Directory where the cache to be used during the build is located."
1002       # yamllint disable rule:line-length
1003       - string:
1004           name: GIT_BASE
1005           default: https://gerrit.opnfv.org/gerrit/$PROJECT
1006           description: "Used for overriding the GIT URL coming from Global Jenkins configuration in case if the stuff is done on none-LF HW."
1007       # yamllint enable rule:line-length
1008       - string:
1009           name: GS_PATHNAME
1010           default: '{gs-pathname}'
1011           description: "Version directory where opnfv artifacts are stored in gs repository"
1012       - string:
1013           name: GS_URL
1014           default: $GS_BASE{gs-pathname}
1015           description: "URL to Google Storage."
1016       - string:
1017           name: PROMOTE
1018           default: 'False'
1019           description: "Flag to know if we should promote/upload snapshot artifacts."
1020
1021 ########################
1022 # builder macros
1023 ########################
1024 {% for stream in scenarios %}
1025 # {{ stream }} Builder
1026 - builder:
1027     name: apex-builder-{{ stream }}
1028     builders:
1029       - multijob:
1030           name: Baremetal Deploy and Test Phase
1031           condition: SUCCESSFUL
1032           projects:
1033 {%- for scenario in scenarios[stream] %}
1034             - name: 'apex-{{ scenario }}-baremetal-{{ stream }}'
1035               node-parameters: false
1036               current-parameters: false
1037               predefined-parameters: |
1038                 OPNFV_CLEAN=yes
1039               kill-phase-on: NEVER
1040               abort-all-job: true
1041               git-revision: false
1042 {%- endfor %}
1043 {% endfor -%}
1044
1045 - builder:
1046     name: 'apex-upload-artifact'
1047     builders:
1048       - shell:
1049           !include-raw: ./apex-upload-artifact.sh
1050
1051 - builder:
1052     name: 'apex-download-artifact'
1053     builders:
1054       - shell:
1055           !include-raw: ./apex-download-artifact.sh
1056
1057 - builder:
1058     name: 'apex-deploy'
1059     builders:
1060       - shell:
1061           !include-raw: ./apex-deploy.sh
1062
1063 - builder:
1064     name: 'apex-fetch-logs'
1065     builders:
1066       - shell:
1067           !include-raw: ./apex-fetch-logs.sh
1068
1069 #######################
1070 # trigger macros
1071 ########################
1072 - trigger:
1073     name: 'apex-master'
1074     triggers:
1075       - timed: '0 0 1-31/2 * *'
1076
1077 - trigger:
1078     name: 'apex-fraser'
1079     triggers:
1080       - timed: '0 0 2-30/2 * *'
1081
1082 - trigger:
1083     name: 'apex-euphrates'
1084     triggers:
1085       - timed: '0 0 2-30/2 * *'
1086
1087 - trigger:
1088     name: 'apex-danube'
1089     triggers:
1090       - timed: '0 3 1 1 7'
1091