2230cd56dcc5ded9520dfeab3f9f9daedd01c3ba
[releng.git] / jjb / xci / xci-verify-jobs.yaml
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-merge-{distro}-.*'
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                 - compare-type: ANT
114                   pattern: 'docs/**'
115                 - compare-type: ANT
116                   pattern: 'upstream/**'
117             - project-compare-type: 'REG_EXP'
118               project-pattern: 'sfc|sdnvpn|releng-xci-scenarios'
119               branches:
120                 - branch-compare-type: 'ANT'
121                   branch-pattern: '**/{branch}'
122               disable-strict-forbidden-file-verification: 'true'
123               file-paths:
124                 - compare-type: ANT
125                   pattern: 'scenarios/**'
126           readable-message: true
127           custom-url: '* $JOB_NAME $BUILD_URL'
128           skip-vote:
129             successful: '{obj:successful}'
130             failed: '{obj:failed}'
131             unstable: '{obj:unstable}'
132             notbuilt: '{obj:notbuilt}'
133
134     parameters:
135       - project-parameter:
136           project: $GERRIT_PROJECT
137           branch: '{branch}'
138       - label:
139           name: SLAVE_LABEL
140           default: 'xci-virtual'
141       - string:
142           name: DISTRO
143           default: '{distro}'
144       - string:
145           name: CLEAN_DIB_IMAGES
146           default: 'true'
147       - string:
148           name: CI_LOOP
149           default: 'verify'
150       - string:
151           name: FUNCTEST_MODE
152           default: 'tier'
153       - string:
154           name: FUNCTEST_SUITE_NAME
155           default: 'healthcheck'
156       - string:
157           name: GIT_BASE
158           default: https://gerrit.opnfv.org/gerrit/$PROJECT
159           description: 'Git URL to use on this Jenkins Slave'
160
161     builders:
162       - 'xci-verify-set-scenario-macro'
163       - inject:
164           properties-file: "/tmp/$GERRIT_CHANGE_NUMBER/$DISTRO/scenario.properties"
165       - description-setter:
166           description: "Scenario: $DEPLOY_SCENARIO | Node: $NODE_NAME"
167       - multijob:
168           name: deploy
169           condition: SUCCESSFUL
170           projects:
171             - name: 'xci-verify-{distro}-deploy-{type}-{stream}'
172               current-parameters: true
173               predefined-parameters: |
174                 DISTRO={distro}
175                 CLEAN_DIB_IMAGES=$CLEAN_DIB_IMAGES
176                 GERRIT_PROJECT=$GERRIT_PROJECT
177                 GERRIT_BRANCH=$GERRIT_BRANCH
178                 GERRIT_REFSPEC=$GERRIT_REFSPEC
179                 GERRIT_CHANGE_NUMBER=$GERRIT_CHANGE_NUMBER
180                 GERRIT_CHANGE_COMMIT_MESSAGE=$GERRIT_CHANGE_COMMIT_MESSAGE
181                 CI_LOOP=$CI_LOOP
182               node-parameters: true
183               kill-phase-on: FAILURE
184               abort-all-job: true
185       - multijob:
186           name: healthcheck
187           condition: SUCCESSFUL
188           projects:
189             - name: 'xci-verify-{distro}-healthcheck-{type}-{stream}'
190               current-parameters: true
191               predefined-parameters: |
192                 DISTRO={distro}
193                 CLEAN_DIB_IMAGES=$CLEAN_DIB_IMAGES
194                 GERRIT_PROJECT=$GERRIT_PROJECT
195                 GERRIT_BRANCH=$GERRIT_BRANCH
196                 GERRIT_REFSPEC=$GERRIT_REFSPEC
197                 GERRIT_CHANGE_NUMBER=$GERRIT_CHANGE_NUMBER
198                 GERRIT_CHANGE_COMMIT_MESSAGE=$GERRIT_CHANGE_COMMIT_MESSAGE
199                 CI_LOOP=$CI_LOOP
200                 FUNCTEST_MODE=$FUNCTEST_MODE
201                 FUNCTEST_SUITE_NAME=$FUNCTEST_SUITE_NAME
202               node-parameters: true
203               kill-phase-on: NEVER
204               abort-all-job: true
205
206     publishers:
207       - postbuildscript:
208           builders:
209             - role: BOTH
210               build-on:
211                 - ABORTED
212                 - FAILURE
213                 - NOT_BUILT
214                 - SUCCESS
215                 - UNSTABLE
216               build-steps:
217                 - shell: !include-raw: ./xci-cleanup.sh
218           mark-unstable-if-failed: true
219
220
221 - job-template:
222     name: 'xci-verify-{distro}-{phase}-{type}-{stream}'
223
224     disabled: false
225
226     concurrent: true
227
228     properties:
229       - logrotate-default
230       - build-blocker:
231           use-build-blocker: true
232           blocking-jobs:
233             - '.*-bifrost-verify-.*'
234             - '.*-bifrost-periodic-.*'
235             - 'osa-verify-.*'
236             - 'osa-periodic-.*'
237           block-level: 'NODE'
238
239     parameters:
240       - string:
241           name: PROJECT
242           default: $GERRIT_PROJECT
243       - string:
244           name: DISTRO
245           default: 'ubuntu'
246       - string:
247           name: CI_LOOP
248           default: 'verify'
249       - string:
250           name: FUNCTEST_MODE
251           default: 'tier'
252       - string:
253           name: FUNCTEST_SUITE_NAME
254           default: 'healthcheck'
255       - string:
256           name: XCI_FLAVOR
257           default: 'mini'
258       - string:
259           name: CLEAN_DIB_IMAGES
260           default: 'true'
261       - string:
262           name: OPNFV_RELENG_DEV_PATH
263           default: $WORKSPACE/
264       - string:
265           name: GIT_BASE
266           default: https://gerrit.opnfv.org/gerrit/$PROJECT
267           description: 'Git URL to use on this Jenkins Slave'
268
269     wrappers:
270       - inject:
271           properties-file: "/tmp/$GERRIT_CHANGE_NUMBER/$DISTRO/scenario.properties"
272       - ssh-agent-wrapper
273       - build-timeout:
274           timeout: 240
275       - fix-workspace-permissions
276
277     scm:
278       - git-scm-gerrit
279
280     builders:
281       - description-setter:
282           description: "Scenario: $DEPLOY_SCENARIO | Node: $NODE_NAME"
283       - 'xci-verify-{phase}-macro'
284
285 # -------------------------------
286 # builder macros
287 # -------------------------------
288 - builder:
289     name: 'xci-verify-set-scenario-macro'
290     builders:
291       - shell:
292           !include-raw: ./xci-set-scenario.sh
293
294 - builder:
295     name: 'xci-verify-deploy-macro'
296     builders:
297       - shell:
298           !include-raw: ./xci-start-new-vm.sh
299
300       - shell:
301           !include-raw: ./xci-start-deployment.sh
302
303 - builder:
304     name: 'xci-verify-healthcheck-macro'
305     builders:
306       - shell:
307           !include-raw: ./xci-run-functest.sh