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