020ec8bacb57fae81870bd5012e9c3e0c2f35ce9
[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: 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             - 'xci-os-.*'
71             - 'xci-k8-.*'
72             - 'openstack-bifrost-verify-{distro}-.*'
73             - 'xci-osa-verify-{distro}-.*'
74             - 'xci-osa-periodic-{distro}-.*'
75           block-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       - string:
144           name: DISTRO
145           default: '{distro}'
146       - string:
147           name: CLEAN_DIB_IMAGES
148           default: 'true'
149       - string:
150           name: CI_LOOP
151           default: 'verify'
152       - string:
153           name: FUNCTEST_MODE
154           default: 'tier'
155       - string:
156           name: FUNCTEST_SUITE_NAME
157           default: 'healthcheck'
158       - string:
159           name: GIT_BASE
160           default: https://gerrit.opnfv.org/gerrit/$PROJECT
161           description: 'Git URL to use on this Jenkins Slave'
162
163     builders:
164       - 'xci-verify-set-scenario-macro'
165       - inject:
166           properties-file: "/tmp/$GERRIT_CHANGE_NUMBER/$DISTRO/scenario.properties"
167       - description-setter:
168           description: "Scenario: $DEPLOY_SCENARIO | Node: $NODE_NAME"
169       - multijob:
170           name: deploy
171           condition: SUCCESSFUL
172           projects:
173             - name: 'xci-verify-{distro}-deploy-{type}-{stream}'
174               current-parameters: true
175               predefined-parameters: |
176                 DISTRO={distro}
177                 CLEAN_DIB_IMAGES=$CLEAN_DIB_IMAGES
178                 GERRIT_PROJECT=$GERRIT_PROJECT
179                 GERRIT_BRANCH=$GERRIT_BRANCH
180                 GERRIT_REFSPEC=$GERRIT_REFSPEC
181                 GERRIT_CHANGE_NUMBER=$GERRIT_CHANGE_NUMBER
182                 GERRIT_CHANGE_COMMIT_MESSAGE=$GERRIT_CHANGE_COMMIT_MESSAGE
183                 CI_LOOP=$CI_LOOP
184                 FUNCTEST_MODE=$FUNCTEST_MODE
185                 FUNCTEST_SUITE_NAME=$FUNCTEST_SUITE_NAME
186               node-parameters: true
187               kill-phase-on: FAILURE
188               abort-all-job: true
189       - multijob:
190           name: healthcheck
191           condition: SUCCESSFUL
192           projects:
193             - name: 'xci-verify-{distro}-healthcheck-{type}-{stream}'
194               current-parameters: true
195               predefined-parameters: |
196                 DISTRO={distro}
197                 CLEAN_DIB_IMAGES=$CLEAN_DIB_IMAGES
198                 GERRIT_PROJECT=$GERRIT_PROJECT
199                 GERRIT_BRANCH=$GERRIT_BRANCH
200                 GERRIT_REFSPEC=$GERRIT_REFSPEC
201                 GERRIT_CHANGE_NUMBER=$GERRIT_CHANGE_NUMBER
202                 GERRIT_CHANGE_COMMIT_MESSAGE=$GERRIT_CHANGE_COMMIT_MESSAGE
203                 CI_LOOP=$CI_LOOP
204                 FUNCTEST_MODE=$FUNCTEST_MODE
205                 FUNCTEST_SUITE_NAME=$FUNCTEST_SUITE_NAME
206               node-parameters: true
207               kill-phase-on: NEVER
208               abort-all-job: true
209
210     publishers:
211       - postbuildscript:
212           builders:
213             - role: BOTH
214               build-on:
215                 - ABORTED
216                 - FAILURE
217                 - NOT_BUILT
218                 - SUCCESS
219                 - UNSTABLE
220               build-steps:
221                 - shell: !include-raw: ./xci-cleanup.sh
222           mark-unstable-if-failed: true
223
224
225 - job-template:
226     name: 'xci-verify-{distro}-{phase}-{type}-{stream}'
227
228     disabled: false
229
230     concurrent: true
231
232     properties:
233       - logrotate-default
234       - build-blocker:
235           use-build-blocker: true
236           blocking-jobs:
237             - '.*-bifrost-verify-.*'
238             - '.*-bifrost-periodic-.*'
239             - 'osa-verify-.*'
240             - 'osa-periodic-.*'
241           block-level: 'NODE'
242
243     parameters:
244       - string:
245           name: PROJECT
246           default: $GERRIT_PROJECT
247       - string:
248           name: DISTRO
249           default: 'ubuntu'
250       - string:
251           name: CI_LOOP
252           default: 'verify'
253       - string:
254           name: FUNCTEST_MODE
255           default: 'tier'
256       - string:
257           name: FUNCTEST_SUITE_NAME
258           default: 'healthcheck'
259       - string:
260           name: XCI_FLAVOR
261           default: 'mini'
262       - string:
263           name: CLEAN_DIB_IMAGES
264           default: 'true'
265       - string:
266           name: OPNFV_RELENG_DEV_PATH
267           default: $WORKSPACE/
268       - string:
269           name: GIT_BASE
270           default: https://gerrit.opnfv.org/gerrit/$PROJECT
271           description: 'Git URL to use on this Jenkins Slave'
272
273     wrappers:
274       - inject:
275           properties-file: "/tmp/$GERRIT_CHANGE_NUMBER/$DISTRO/scenario.properties"
276       - ssh-agent-wrapper
277       - build-timeout:
278           timeout: 240
279       - fix-workspace-permissions
280
281     scm:
282       - git-scm-gerrit
283
284     builders:
285       - description-setter:
286           description: "Scenario: $DEPLOY_SCENARIO | Node: $NODE_NAME"
287       - 'xci-verify-{phase}-macro'
288
289 # -------------------------------
290 # builder macros
291 # -------------------------------
292 - builder:
293     name: 'xci-verify-set-scenario-macro'
294     builders:
295       - shell:
296           !include-raw: ./xci-set-scenario.sh
297
298 - builder:
299     name: 'xci-verify-deploy-macro'
300     builders:
301       - shell:
302           !include-raw: ./xci-start-new-vm.sh
303
304       - shell:
305           !include-raw: ./xci-start-deployment.sh
306
307 - builder:
308     name: 'xci-verify-healthcheck-macro'
309     builders:
310       - shell:
311           !include-raw: ./xci-run-functest.sh