c54a1b9414832809cf4b9a09f15f82f5af775e64
[releng.git] / jjb / xci / xci-verify-jobs.yml
1 ---
2 - project:
3     name: 'opnfv-xci-verify'
4
5     project: releng-xci
6     # -------------------------------
7     # branches
8     # -------------------------------
9     stream:
10       - master:
11           branch: '{stream}'
12     # -------------------------------
13     # distros
14     # -------------------------------
15     distro:
16       - ubuntu:
17           disabled: false
18           successful: false
19           failed: false
20           unstable: false
21           notbuilt: false
22       - centos:
23           disabled: false
24           successful: true
25           failed: true
26           unstable: true
27           notbuilt: true
28       - opensuse:
29           disabled: false
30           successful: false
31           failed: false
32           unstable: false
33           notbuilt: false
34     # -------------------------------
35     # type
36     # -------------------------------
37     type:
38       - virtual
39     # -------------------------------
40     # patch verification phases
41     # -------------------------------
42     phase:
43       - 'deploy'
44       - 'healthcheck'
45     # -------------------------------
46     # jobs
47     # -------------------------------
48     jobs:
49       - 'xci-verify-{distro}-{type}-{stream}'
50       - 'xci-verify-{distro}-{phase}-{type}-{stream}'
51 # -------------------------------
52 # job templates
53 # -------------------------------
54 - job-template:
55     name: 'xci-verify-{distro}-{type}-{stream}'
56
57     project-type: multijob
58
59     disabled: '{obj:disabled}'
60
61     concurrent: true
62
63     properties:
64       - logrotate-default
65       - build-blocker:
66           use-build-blocker: true
67           blocking-jobs:
68             - 'xci-verify-{distro}-.*'
69             - 'xci-.*-{distro}-merge-.*'
70             - 'openstack-bifrost-verify-{distro}-.*'
71             - 'xci-osa-verify-{distro}-.*'
72             - 'xci-osa-periodic-{distro}-.*'
73           block-level: 'NODE'
74       - throttle:
75           max-per-node: 2
76           max-total: 10
77           categories:
78             - xci-verify-virtual
79           option: category
80
81     wrappers:
82       - ssh-agent-wrapper
83       - build-timeout:
84           timeout: 240
85       - fix-workspace-permissions
86
87     scm:
88       - git-scm-gerrit
89
90     triggers:
91       - gerrit:
92           server-name: 'gerrit.opnfv.org'
93           trigger-on:
94             - patchset-created-event:
95                 exclude-drafts: 'false'
96                 exclude-trivial-rebase: 'false'
97                 exclude-no-code-change: 'true'
98             - draft-published-event
99             - comment-added-contains-event:
100                 comment-contains-value: 'recheck'
101             - comment-added-contains-event:
102                 comment-contains-value: 'reverify'
103           projects:
104             - project-compare-type: 'ANT'
105               project-pattern: 'releng-xci'
106               branches:
107                 - branch-compare-type: 'ANT'
108                   branch-pattern: '**/{branch}'
109               disable-strict-forbidden-file-verification: 'false'
110               forbidden-file-paths:
111                 - compare-type: ANT
112                   pattern: 'xci/scripts/vm/**'
113             - project-compare-type: 'REG_EXP'
114               project-pattern: 'sfc|sdnvpn'
115               branches:
116                 - branch-compare-type: 'ANT'
117                   branch-pattern: '**/{branch}'
118               disable-strict-forbidden-file-verification: 'true'
119               file-paths:
120                 - compare-type: ANT
121                   pattern: 'scenarios/**'
122           readable-message: true
123           custom-url: '* $JOB_NAME $BUILD_URL'
124           skip-vote:
125             successful: '{obj:successful}'
126             failed: '{obj:failed}'
127             unstable: '{obj:unstable}'
128             notbuilt: '{obj:notbuilt}'
129
130     parameters:
131       - project-parameter:
132           project: $GERRIT_PROJECT
133           branch: '{branch}'
134       - label:
135           name: SLAVE_LABEL
136           default: 'xci-virtual'
137       - string:
138           name: DISTRO
139           default: '{distro}'
140       - string:
141           name: CLEAN_DIB_IMAGES
142           default: 'true'
143       - string:
144           name: GIT_BASE
145           default: https://gerrit.opnfv.org/gerrit/$PROJECT
146           description: 'Git URL to use on this Jenkins Slave'
147
148     builders:
149       - 'xci-verify-set-scenario-macro'
150       - inject:
151           properties-file: "/tmp/$GERRIT_CHANGE_NUMBER/$DISTRO/scenario.properties"
152       - description-setter:
153           description: "Scenario: $DEPLOY_SCENARIO | Node: $NODE_NAME"
154       - multijob:
155           name: deploy
156           condition: SUCCESSFUL
157           projects:
158             - name: 'xci-verify-{distro}-deploy-{type}-{stream}'
159               current-parameters: true
160               predefined-parameters: |
161                 DISTRO={distro}
162                 CLEAN_DIB_IMAGES=$CLEAN_DIB_IMAGES
163                 GERRIT_PROJECT=$GERRIT_PROJECT
164                 GERRIT_BRANCH=$GERRIT_BRANCH
165                 GERRIT_REFSPEC=$GERRIT_REFSPEC
166                 GERRIT_CHANGE_NUMBER=$GERRIT_CHANGE_NUMBER
167                 GERRIT_CHANGE_COMMIT_MESSAGE=$GERRIT_CHANGE_COMMIT_MESSAGE
168               node-parameters: true
169               kill-phase-on: FAILURE
170               abort-all-job: true
171       - multijob:
172           name: healthcheck
173           condition: SUCCESSFUL
174           projects:
175             - name: 'xci-verify-{distro}-healthcheck-{type}-{stream}'
176               current-parameters: true
177               predefined-parameters: |
178                 DISTRO={distro}
179                 CLEAN_DIB_IMAGES=$CLEAN_DIB_IMAGES
180                 GERRIT_PROJECT=$GERRIT_PROJECT
181                 GERRIT_BRANCH=$GERRIT_BRANCH
182                 GERRIT_REFSPEC=$GERRIT_REFSPEC
183                 GERRIT_CHANGE_NUMBER=$GERRIT_CHANGE_NUMBER
184                 GERRIT_CHANGE_COMMIT_MESSAGE=$GERRIT_CHANGE_COMMIT_MESSAGE
185                 FUNCTEST_MODE=tier
186                 FUNCTEST_TIER=healthcheck
187               node-parameters: true
188               kill-phase-on: NEVER
189               abort-all-job: true
190
191 - job-template:
192     name: 'xci-verify-{distro}-{phase}-{type}-{stream}'
193
194     disabled: false
195
196     concurrent: true
197
198     properties:
199       - logrotate-default
200       - build-blocker:
201           use-build-blocker: true
202           blocking-jobs:
203             - '.*-bifrost-verify-.*'
204             - '.*-bifrost-periodic-.*'
205             - 'osa-verify-.*'
206             - 'osa-periodic-.*'
207           block-level: 'NODE'
208
209     parameters:
210       - string:
211           name: PROJECT
212           default: $GERRIT_PROJECT
213       - string:
214           name: DISTRO
215           default: 'ubuntu'
216       - string:
217           name: FUNCTEST_MODE
218           default: 'tier'
219       - string:
220           name: FUNCTEST_SUITE_NAME
221           default: 'healthcheck'
222       - string:
223           name: XCI_FLAVOR
224           default: 'mini'
225       - string:
226           name: CLEAN_DIB_IMAGES
227           default: 'true'
228       - string:
229           name: OPNFV_RELENG_DEV_PATH
230           default: $WORKSPACE/
231       - string:
232           name: INSTALLER_TYPE
233           default: 'osa'
234       - string:
235           name: GIT_BASE
236           default: https://gerrit.opnfv.org/gerrit/$PROJECT
237           description: 'Git URL to use on this Jenkins Slave'
238
239     wrappers:
240       - inject:
241           properties-file: "/tmp/$GERRIT_CHANGE_NUMBER/$DISTRO/scenario.properties"
242       - ssh-agent-wrapper
243       - build-timeout:
244           timeout: 240
245       - fix-workspace-permissions
246
247     scm:
248       - git-scm-gerrit
249
250     builders:
251       - description-setter:
252           description: "Scenario: $DEPLOY_SCENARIO | Node: $NODE_NAME"
253       - 'xci-verify-{phase}-macro'
254
255 # -------------------------------
256 # builder macros
257 # -------------------------------
258 - builder:
259     name: 'xci-verify-set-scenario-macro'
260     builders:
261       - shell:
262           !include-raw: ./xci-set-scenario.sh
263
264 - builder:
265     name: 'xci-verify-deploy-macro'
266     builders:
267       - shell:
268           !include-raw: ./xci-start-new-vm.sh
269
270       - shell:
271           !include-raw: ./xci-start-deployment.sh
272
273 - builder:
274     name: 'xci-verify-healthcheck-macro'
275     builders:
276       - shell:
277           !include-raw: ./xci-run-functest.sh
278       - shell:
279           !include-raw: ./xci-cleanup.sh