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