Merge "xci: Enable post merge promotion for generic scenarios"
[releng.git] / jjb / xci / xci-merge-jobs.yml
1 ---
2 - project:
3     name: 'opnfv-xci-merge'
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       - centos:
19           disabled: false
20       - opensuse:
21           disabled: false
22     # -------------------------------
23     # postmerge promotion phases
24     # -------------------------------
25     phase:
26       - 'deploy'
27       - 'healthcheck'
28     # -------------------------------
29     # jobs
30     # -------------------------------
31     jobs:
32       - 'xci-merge-virtual-{stream}'
33       - 'xci-merge-promote-virtual-{stream}'
34       - 'xci-merge-{distro}-virtual-{stream}'
35       - 'xci-merge-{distro}-{phase}-virtual-{stream}'
36 # -------------------------------
37 # job templates
38 # -------------------------------
39 - job-template:
40     name: 'xci-merge-virtual-{stream}'
41
42     project-type: multijob
43
44     disabled: false
45
46     concurrent: false
47
48     properties:
49       - logrotate-default
50
51     wrappers:
52       - ssh-agent-wrapper
53       - build-timeout:
54           timeout: 240
55       - fix-workspace-permissions
56
57     scm:
58       - git-scm-gerrit
59
60     triggers:
61       - gerrit:
62           server-name: 'gerrit.opnfv.org'
63           trigger-on:
64             - change-merged-event
65             - comment-added-contains-event:
66                 comment-contains-value: 'remerge'
67           projects:
68             - project-compare-type: 'ANT'
69               project-pattern: 'releng-xci'
70               branches:
71                 - branch-compare-type: 'ANT'
72                   branch-pattern: '**/{branch}'
73               disable-strict-forbidden-file-verification: 'false'
74               forbidden-file-paths:
75                 - compare-type: ANT
76                   pattern: 'xci/scripts/vm/**'
77                 - compare-type: ANT
78                   pattern: 'docs/**'
79                 - compare-type: ANT
80                   pattern: 'prototypes/**'
81                 - compare-type: ANT
82                   pattern: 'upstream/**'
83             - project-compare-type: 'REG_EXP'
84               project-pattern: 'sfc|sdnvpn'
85               branches:
86                 - branch-compare-type: 'ANT'
87                   branch-pattern: '**/{branch}'
88               disable-strict-forbidden-file-verification: 'true'
89               file-paths:
90                 - compare-type: ANT
91                   pattern: 'scenarios/**'
92           readable-message: true
93           custom-url: '* $JOB_NAME $BUILD_URL'
94
95     parameters:
96       - project-parameter:
97           project: $GERRIT_PROJECT
98           branch: '{branch}'
99       - label:
100           name: SLAVE_LABEL
101           default: 'xci-virtual'
102       - string:
103           name: DISTRO
104           default: 'all'
105       - string:
106           name: CLEAN_DIB_IMAGES
107           default: 'true'
108       - string:
109           name: GIT_BASE
110           default: https://gerrit.opnfv.org/gerrit/$PROJECT
111           description: 'Git URL to use on this Jenkins Slave'
112
113     builders:
114       - 'xci-merge-set-scenario-macro'
115       - inject:
116           properties-file: "/tmp/$GERRIT_CHANGE_NUMBER/$DISTRO/scenario.properties"
117       - description-setter:
118           description: "Scenario: $DEPLOY_SCENARIO | Node: $NODE_NAME"
119       - multijob:
120           name: deploy and test
121           condition: SUCCESSFUL
122           projects:
123             - name: 'xci-merge-opensuse-virtual-{stream}'
124               current-parameters: false
125               predefined-parameters: |
126                 DISTRO=opensuse
127                 CLEAN_DIB_IMAGES=$CLEAN_DIB_IMAGES
128                 GERRIT_PROJECT=$GERRIT_PROJECT
129                 GERRIT_BRANCH=$GERRIT_BRANCH
130                 GERRIT_REFSPEC=$GERRIT_REFSPEC
131                 GERRIT_CHANGE_NUMBER=$GERRIT_CHANGE_NUMBER
132                 GERRIT_CHANGE_COMMIT_MESSAGE=$GERRIT_CHANGE_COMMIT_MESSAGE
133               node-parameters: false
134               kill-phase-on: FAILURE
135               abort-all-job: true
136             - name: 'xci-merge-ubuntu-virtual-{stream}'
137               current-parameters: false
138               predefined-parameters: |
139                 DISTRO=ubuntu
140                 CLEAN_DIB_IMAGES=$CLEAN_DIB_IMAGES
141                 GERRIT_PROJECT=$GERRIT_PROJECT
142                 GERRIT_BRANCH=$GERRIT_BRANCH
143                 GERRIT_REFSPEC=$GERRIT_REFSPEC
144                 GERRIT_CHANGE_NUMBER=$GERRIT_CHANGE_NUMBER
145                 GERRIT_CHANGE_COMMIT_MESSAGE=$GERRIT_CHANGE_COMMIT_MESSAGE
146               node-parameters: false
147               kill-phase-on: FAILURE
148               abort-all-job: true
149             - name: 'xci-merge-centos-virtual-{stream}'
150               current-parameters: false
151               predefined-parameters: |
152                 DISTRO=centos
153                 CLEAN_DIB_IMAGES=$CLEAN_DIB_IMAGES
154                 GERRIT_PROJECT=$GERRIT_PROJECT
155                 GERRIT_BRANCH=$GERRIT_BRANCH
156                 GERRIT_REFSPEC=$GERRIT_REFSPEC
157                 GERRIT_CHANGE_NUMBER=$GERRIT_CHANGE_NUMBER
158                 GERRIT_CHANGE_COMMIT_MESSAGE=$GERRIT_CHANGE_COMMIT_MESSAGE
159               node-parameters: false
160               kill-phase-on: NEVER
161               abort-all-job: false
162       - inject:
163           properties-file: "/tmp/$GERRIT_CHANGE_NUMBER/$DISTRO/scenario.properties"
164       - multijob:
165           name: promote
166           condition: SUCCESSFUL
167           projects:
168             - name: 'xci-merge-promote-virtual-{stream}'
169               current-parameters: true
170               predefined-parameters: |
171                 GERRIT_PROJECT=$GERRIT_PROJECT
172                 GERRIT_BRANCH=$GERRIT_BRANCH
173                 GERRIT_REFSPEC=$GERRIT_REFSPEC
174                 GERRIT_CHANGE_NUMBER=$GERRIT_CHANGE_NUMBER
175                 GERRIT_CHANGE_COMMIT_MESSAGE=$GERRIT_CHANGE_COMMIT_MESSAGE
176               node-parameters: true
177               kill-phase-on: NEVER
178               abort-all-job: true
179
180 - job-template:
181     name: 'xci-merge-{distro}-virtual-{stream}'
182
183     project-type: multijob
184
185     disabled: false
186
187     concurrent: false
188
189     properties:
190       - logrotate-default
191       - build-blocker:
192           use-build-blocker: true
193           blocking-jobs:
194             - 'xci-verify-{distro}-.*'
195             - 'xci-merge-{distro}-.*'
196             - 'openstack-bifrost-verify-{distro}-.*'
197             - 'xci-osa-verify-{distro}-.*'
198             - 'xci-osa-periodic-{distro}-.*'
199           block-level: 'NODE'
200       - throttle:
201           max-per-node: 1
202           max-total: 3
203           categories:
204             - xci-verify-virtual
205           option: category
206
207     wrappers:
208       - ssh-agent-wrapper
209       - build-timeout:
210           timeout: 240
211       - fix-workspace-permissions
212
213     scm:
214       - git-scm-gerrit
215
216     parameters:
217       - project-parameter:
218           project: $GERRIT_PROJECT
219           branch: '{branch}'
220       - label:
221           name: SLAVE_LABEL
222           default: 'xci-virtual'
223       - string:
224           name: DISTRO
225           default: '{distro}'
226       - string:
227           name: CLEAN_DIB_IMAGES
228           default: 'true'
229       - string:
230           name: GIT_BASE
231           default: https://gerrit.opnfv.org/gerrit/$PROJECT
232           description: 'Git URL to use on this Jenkins Slave'
233
234     builders:
235       - 'xci-merge-set-scenario-macro'
236       - inject:
237           properties-file: "/tmp/$GERRIT_CHANGE_NUMBER/$DISTRO/scenario.properties"
238       - description-setter:
239           description: "Scenario: $DEPLOY_SCENARIO | Node: $NODE_NAME"
240       - multijob:
241           name: deploy
242           condition: SUCCESSFUL
243           projects:
244             - name: 'xci-merge-{distro}-deploy-virtual-{stream}'
245               current-parameters: true
246               predefined-parameters: |
247                 DISTRO={distro}
248                 CLEAN_DIB_IMAGES=$CLEAN_DIB_IMAGES
249                 GERRIT_PROJECT=$GERRIT_PROJECT
250                 GERRIT_BRANCH=$GERRIT_BRANCH
251                 GERRIT_REFSPEC=$GERRIT_REFSPEC
252                 GERRIT_CHANGE_NUMBER=$GERRIT_CHANGE_NUMBER
253                 GERRIT_CHANGE_COMMIT_MESSAGE=$GERRIT_CHANGE_COMMIT_MESSAGE
254               node-parameters: true
255               kill-phase-on: FAILURE
256               abort-all-job: true
257       - multijob:
258           name: healthcheck
259           condition: SUCCESSFUL
260           projects:
261             - name: 'xci-merge-{distro}-healthcheck-virtual-{stream}'
262               current-parameters: true
263               predefined-parameters: |
264                 DISTRO={distro}
265                 CLEAN_DIB_IMAGES=$CLEAN_DIB_IMAGES
266                 GERRIT_PROJECT=$GERRIT_PROJECT
267                 GERRIT_BRANCH=$GERRIT_BRANCH
268                 GERRIT_REFSPEC=$GERRIT_REFSPEC
269                 GERRIT_CHANGE_NUMBER=$GERRIT_CHANGE_NUMBER
270                 GERRIT_CHANGE_COMMIT_MESSAGE=$GERRIT_CHANGE_COMMIT_MESSAGE
271                 FUNCTEST_MODE=tier
272                 FUNCTEST_TIER=healthcheck
273               node-parameters: true
274               kill-phase-on: NEVER
275               abort-all-job: true
276
277     publishers:
278       - postbuildscript:
279           script-only-if-succeeded: false
280           script-only-if-failed: false
281           builders:
282             - shell:
283                 !include-raw: ./xci-cleanup.sh
284
285 - job-template:
286     name: 'xci-merge-{distro}-{phase}-virtual-{stream}'
287
288     disabled: false
289
290     concurrent: false
291
292     properties:
293       - logrotate-default
294       - build-blocker:
295           use-build-blocker: true
296           blocking-jobs:
297             - '.*-bifrost-verify-.*'
298             - '.*-bifrost-periodic-.*'
299             - 'osa-verify-.*'
300             - 'osa-periodic-.*'
301           block-level: 'NODE'
302
303     parameters:
304       - string:
305           name: PROJECT
306           default: $GERRIT_PROJECT
307       - string:
308           name: DISTRO
309           default: 'ubuntu'
310       - string:
311           name: FUNCTEST_MODE
312           default: 'tier'
313       - string:
314           name: FUNCTEST_SUITE_NAME
315           default: 'healthcheck'
316       - string:
317           name: XCI_FLAVOR
318           default: 'mini'
319       - string:
320           name: CLEAN_DIB_IMAGES
321           default: 'true'
322       - string:
323           name: OPNFV_RELENG_DEV_PATH
324           default: $WORKSPACE/
325       - string:
326           name: GIT_BASE
327           default: https://gerrit.opnfv.org/gerrit/$PROJECT
328           description: 'Git URL to use on this Jenkins Slave'
329
330     wrappers:
331       - inject:
332           properties-file: "/tmp/$GERRIT_CHANGE_NUMBER/$DISTRO/scenario.properties"
333       - ssh-agent-wrapper
334       - build-timeout:
335           timeout: 240
336       - fix-workspace-permissions
337
338     scm:
339       - git-scm-gerrit
340
341     builders:
342       - description-setter:
343           description: "Scenario: $DEPLOY_SCENARIO | Node: $NODE_NAME"
344       - 'xci-merge-{phase}-macro'
345
346 - job-template:
347     name: 'xci-merge-promote-virtual-{stream}'
348
349     disabled: false
350
351     concurrent: false
352
353     properties:
354       - logrotate-default
355
356     parameters:
357       - string:
358           name: PROJECT
359           default: $GERRIT_PROJECT
360       - string:
361           name: DISTRO
362           default: 'all'
363       - string:
364           name: OPNFV_RELENG_DEV_PATH
365           default: $WORKSPACE/
366       - string:
367           name: LOCAL_PROMOTION_METADATA_FILE
368           default: "/tmp/$GERRIT_CHANGE_NUMBER/$DISTRO/scenario.properties"
369       - string:
370           name: REMOTE_PROMOTION_METADATA_FILE
371           default: "gs://artifacts.opnfv.org/xci/pipeline/merge/$DEPLOY_SCENARIO.properties"
372       - string:
373           name: GIT_BASE
374           default: https://gerrit.opnfv.org/gerrit/$PROJECT
375           description: 'Git URL to use on this Jenkins Slave'
376
377     wrappers:
378       - inject:
379           properties-file: "/tmp/$GERRIT_CHANGE_NUMBER/$DISTRO/scenario.properties"
380       - ssh-agent-wrapper
381       - build-timeout:
382           timeout: 240
383       - fix-workspace-permissions
384
385     builders:
386       - description-setter:
387           description: "Scenario: $DEPLOY_SCENARIO | Node: $NODE_NAME"
388       - 'xci-merge-promote-macro'
389
390 # -------------------------------
391 # builder macros
392 # -------------------------------
393 - builder:
394     name: 'xci-merge-set-scenario-macro'
395     builders:
396       - shell:
397           !include-raw: ./xci-set-scenario.sh
398
399 - builder:
400     name: 'xci-merge-deploy-macro'
401     builders:
402       - shell:
403           !include-raw: ./xci-start-new-vm.sh
404
405       - shell:
406           !include-raw: ./xci-start-deployment.sh
407
408 - builder:
409     name: 'xci-merge-healthcheck-macro'
410     builders:
411       - shell:
412           !include-raw: ./xci-run-functest.sh
413
414 - builder:
415     name: 'xci-merge-promote-macro'
416     builders:
417       - shell:
418           !include-raw: ./xci-promote.sh