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