Configure voting for verify jobs
[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: true
24           successful: true
25           failed: true
26           unstable: true
27           notbuilt: true
28       - opensuse:
29           disabled: false
30           successful: true
31           failed: true
32           unstable: true
33           notbuilt: true
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             - 'xci-os-.*'
71             - 'xci-k8-.*'
72             - 'openstack-bifrost-verify-{distro}-.*'
73             - 'xci-osa-verify-{distro}-.*'
74             - 'xci-osa-periodic-{distro}-.*'
75           blocking-level: 'NODE'
76       - throttle:
77           max-per-node: 2
78           max-total: 10
79           categories:
80             - xci-verify-virtual
81           option: category
82
83     wrappers:
84       - ssh-agent-wrapper
85       - build-timeout:
86           timeout: 240
87       - fix-workspace-permissions
88
89     scm:
90       - git-scm-gerrit
91
92     triggers:
93       - gerrit:
94           server-name: 'gerrit.opnfv.org'
95           trigger-on:
96             - patchset-created-event:
97                 exclude-drafts: 'false'
98                 exclude-trivial-rebase: 'false'
99                 exclude-no-code-change: 'true'
100             - draft-published-event
101             - comment-added-contains-event:
102                 comment-contains-value: 'recheck'
103             - comment-added-contains-event:
104                 comment-contains-value: 'reverify'
105           projects:
106             - project-compare-type: 'ANT'
107               project-pattern: 'releng-xci'
108               branches:
109                 - branch-compare-type: 'ANT'
110                   branch-pattern: '**/{branch}'
111               disable-strict-forbidden-file-verification: 'false'
112               forbidden-file-paths:
113                 - compare-type: ANT
114                   pattern: 'xci/scripts/vm/**'
115                 - compare-type: ANT
116                   pattern: 'docs/**'
117                 - compare-type: ANT
118                   pattern: 'upstream/**'
119             - project-compare-type: 'REG_EXP'
120               project-pattern: 'sfc|sdnvpn|releng-xci-scenarios'
121               branches:
122                 - branch-compare-type: 'ANT'
123                   branch-pattern: '**/{branch}'
124               disable-strict-forbidden-file-verification: 'true'
125               file-paths:
126                 - compare-type: ANT
127                   pattern: 'scenarios/**'
128           readable-message: true
129           custom-url: '* $JOB_NAME $BUILD_URL'
130           skip-vote:
131             successful: '{obj:successful}'
132             failed: '{obj:failed}'
133             unstable: '{obj:unstable}'
134             notbuilt: '{obj:notbuilt}'
135
136     parameters:
137       - project-parameter:
138           project: $GERRIT_PROJECT
139           branch: '{branch}'
140       - label:
141           name: SLAVE_LABEL
142           default: 'xci-virtual'
143           all-nodes: false
144           node-eligibility: 'ignore-offline'
145       - string:
146           name: DISTRO
147           default: '{distro}'
148       - string:
149           name: CLEAN_DIB_IMAGES
150           default: 'true'
151       - string:
152           name: CI_LOOP
153           default: 'verify'
154       - string:
155           name: FUNCTEST_VERSION
156           default: 'hunter'
157       - string:
158           name: FUNCTEST_MODE
159           default: 'tier'
160       - string:
161           name: FUNCTEST_SUITE_NAME
162           default: 'healthcheck'
163       - string:
164           name: GIT_BASE
165           default: https://gerrit.opnfv.org/gerrit/$PROJECT
166           description: 'Git URL to use on this Jenkins Slave'
167
168     builders:
169       - 'xci-verify-clean-vm-macro'
170       - 'xci-verify-set-scenario-macro'
171       - inject:
172           properties-file: "/tmp/$GERRIT_CHANGE_NUMBER/$DISTRO/scenario.properties"
173       - description-setter:
174           description: "Scenario: $DEPLOY_SCENARIO | Node: $NODE_NAME"
175       - multijob:
176           name: deploy
177           condition: SUCCESSFUL
178           projects:
179             - name: 'xci-verify-{distro}-deploy-{type}-{stream}'
180               current-parameters: true
181               predefined-parameters: |
182                 DISTRO={distro}
183                 CLEAN_DIB_IMAGES=$CLEAN_DIB_IMAGES
184                 GERRIT_PROJECT=$GERRIT_PROJECT
185                 GERRIT_BRANCH=$GERRIT_BRANCH
186                 GERRIT_REFSPEC=$GERRIT_REFSPEC
187                 GERRIT_CHANGE_NUMBER=$GERRIT_CHANGE_NUMBER
188                 GERRIT_CHANGE_COMMIT_MESSAGE=$GERRIT_CHANGE_COMMIT_MESSAGE
189                 CI_LOOP=$CI_LOOP
190                 FUNCTEST_VERSION=$FUNCTEST_VERSION
191                 FUNCTEST_MODE=$FUNCTEST_MODE
192                 FUNCTEST_SUITE_NAME=$FUNCTEST_SUITE_NAME
193               node-parameters: true
194               kill-phase-on: FAILURE
195               abort-all-job: true
196       - multijob:
197           name: healthcheck
198           condition: SUCCESSFUL
199           projects:
200             - name: 'xci-verify-{distro}-healthcheck-{type}-{stream}'
201               current-parameters: true
202               predefined-parameters: |
203                 DISTRO={distro}
204                 CLEAN_DIB_IMAGES=$CLEAN_DIB_IMAGES
205                 GERRIT_PROJECT=$GERRIT_PROJECT
206                 GERRIT_BRANCH=$GERRIT_BRANCH
207                 GERRIT_REFSPEC=$GERRIT_REFSPEC
208                 GERRIT_CHANGE_NUMBER=$GERRIT_CHANGE_NUMBER
209                 GERRIT_CHANGE_COMMIT_MESSAGE=$GERRIT_CHANGE_COMMIT_MESSAGE
210                 CI_LOOP=$CI_LOOP
211                 FUNCTEST_VERSION=$FUNCTEST_VERSION
212                 FUNCTEST_MODE=$FUNCTEST_MODE
213                 FUNCTEST_SUITE_NAME=$FUNCTEST_SUITE_NAME
214               node-parameters: true
215               kill-phase-on: NEVER
216               abort-all-job: true
217
218     publishers:
219       - postbuildscript:
220           builders:
221             - role: BOTH
222               build-on:
223                 - ABORTED
224                 - NOT_BUILT
225                 - SUCCESS
226                 - UNSTABLE
227               build-steps:
228                 - shell: !include-raw: ./xci-cleanup.sh
229           mark-unstable-if-failed: true
230
231
232 - job-template:
233     name: 'xci-verify-{distro}-{phase}-{type}-{stream}'
234
235     disabled: false
236
237     concurrent: true
238
239     properties:
240       - logrotate-default
241       - build-blocker:
242           use-build-blocker: true
243           blocking-jobs:
244             - '.*-bifrost-verify-.*'
245             - '.*-bifrost-periodic-.*'
246             - 'osa-verify-.*'
247             - 'osa-periodic-.*'
248           blocking-level: 'NODE'
249
250     parameters:
251       - string:
252           name: PROJECT
253           default: $GERRIT_PROJECT
254       - string:
255           name: DISTRO
256           default: 'ubuntu'
257       - string:
258           name: CI_LOOP
259           default: 'verify'
260       - string:
261           name: FUNCTEST_VERSION
262           default: 'hunter'
263       - string:
264           name: FUNCTEST_MODE
265           default: 'tier'
266       - string:
267           name: FUNCTEST_SUITE_NAME
268           default: 'healthcheck'
269       - string:
270           name: XCI_FLAVOR
271           default: 'mini'
272       - string:
273           name: CLEAN_DIB_IMAGES
274           default: 'true'
275       - string:
276           name: OPNFV_RELENG_DEV_PATH
277           default: $WORKSPACE/
278       - string:
279           name: GIT_BASE
280           default: https://gerrit.opnfv.org/gerrit/$PROJECT
281           description: 'Git URL to use on this Jenkins Slave'
282
283     wrappers:
284       - inject:
285           properties-file: "/tmp/$GERRIT_CHANGE_NUMBER/$DISTRO/scenario.properties"
286       - ssh-agent-wrapper
287       - build-timeout:
288           timeout: 240
289       - fix-workspace-permissions
290
291     scm:
292       - git-scm-gerrit
293
294     builders:
295       - description-setter:
296           description: "Scenario: $DEPLOY_SCENARIO | Node: $NODE_NAME"
297       - 'xci-verify-{phase}-macro'
298
299 # -------------------------------
300 # builder macros
301 # -------------------------------
302 - builder:
303     name: 'xci-verify-clean-vm-macro'
304     builders:
305       - shell:
306           !include-raw: ./xci-cleanup.sh
307
308 - builder:
309     name: 'xci-verify-set-scenario-macro'
310     builders:
311       - shell:
312           !include-raw: ./xci-set-scenario.sh
313
314 - builder:
315     name: 'xci-verify-deploy-macro'
316     builders:
317       - shell:
318           !include-raw: ./xci-start-new-vm.sh
319
320       - shell:
321           !include-raw: ./xci-start-deployment.sh
322
323 - builder:
324     name: 'xci-verify-healthcheck-macro'
325     builders:
326       - shell:
327           !include-raw: ./xci-run-functest.sh