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