Merge "Add Dovetail Docker jobs for Hunter branch"
[releng.git] / jjb / functest / xtesting.yaml
1 ---
2 - xtesting-jobs: &xtesting-jobs
3     name: 'xtesting-jobs'
4     current-parameters: true
5
6 - xtesting-params: &xtesting-params
7     name: 'xtesting-params'
8     repo: 'opnfv'
9     port:
10     tag:
11       - latest:
12           branch: master
13           slave: lf-virtual1
14       - jerma:
15           branch: stable/jerma
16           slave: lf-virtual1
17       - iruya:
18           branch: stable/iruya
19           slave: lf-virtual1
20       - hunter:
21           branch: stable/hunter
22           slave: lf-virtual1
23
24 - parameter:
25     name: xtesting-slave
26     parameters:
27       - label:
28           name: slave
29           default: '{slave}'
30
31 - parameter:
32     name: xtesting-build_tag
33     parameters:
34       - random-string:
35           name: build_tag
36
37 - parameter:
38     name: xtesting-branch
39     parameters:
40       - string:
41           name: branch
42           default: '{branch}'
43
44 - xtesting-containers: &xtesting-containers
45     name: 'xtesting-containers'
46     repo: '{repo}'
47     port: '{port}'
48     container: '{container}'
49     tag: '{tag}'
50
51 - xtesting-run-containers: &xtesting-run-containers
52     name: 'xtesting-build-containers'
53     <<: *xtesting-containers
54     test: '{test}'
55
56 - xtesting-build-containers: &xtesting-build-containers
57     name: 'xtesting-build-containers'
58     <<: *xtesting-containers
59     ref_arg: '{ref_arg}'
60     path: '{path}'
61
62 - builder:
63     name: xtesting-pull-containers
64     builders:
65       - shell: |
66           set +x
67           if [ "{repo}" = "_" ]; then
68             image={container}:{tag}
69           elif [ "{port}" = "None" ]; then
70             image={repo}/{container}:{tag}
71           else
72             image={repo}:{port}/{container}:{tag}
73           fi
74           sudo docker pull $image
75
76 - builder:
77     name: xtesting-build-containers
78     builders:
79       - shell: |
80           set +x
81           if [ "{repo}" = "_" ]; then
82             image={container}:{tag}
83           elif [ "{port}" = "None" ]; then
84             image={repo}/{container}:{tag}
85           else
86             image={repo}:{port}/{container}:{tag}
87           fi
88           if [ "{ref_arg}" = "None" ]; then
89             build_arg=""
90           else
91             build_arg="--build-arg {ref_arg}={ref}"
92           fi
93           cd {path}
94           sudo docker build $build_arg \
95             --pull=false --no-cache --force-rm=true \
96             -t $image .
97
98 - builder:
99     name: xtesting-run-containers
100     builders:
101       - shell: |
102           set +x
103           [ ! -z "$WORKSPACE" ] && sudo rm -rf $WORKSPACE/* || true
104           if [ "{repo}" = "_" ]; then
105             image={container}:{tag}
106           elif [ "{port}" = "None" ]; then
107             image={repo}/{container}:{tag}
108           else
109             image={repo}:{port}/{container}:{tag}
110           fi
111           sudo docker run --rm \
112             -e S3_ENDPOINT_URL=https://storage.googleapis.com \
113             -e S3_DST_URL=s3://artifacts.opnfv.org/xtesting/$BUILD_TAG/$JOB_NAME-$BUILD_ID \
114             -e HTTP_DST_URL=http://artifacts.opnfv.org/xtesting/$BUILD_TAG/$JOB_NAME-$BUILD_ID \
115             -e BUILD_TAG=$BUILD_TAG \
116             -v $WORKSPACE/../$JOB_NAME/results:/var/lib/xtesting/results \
117             -v /home/opnfv/xtesting/.boto:/root/.boto \
118             -e DEBUG=true \
119             $image run_tests -t {test} -p
120
121 - builder:
122     name: xtesting-remove-images
123     builders:
124       - shell: |
125           set +x
126           if [ "{repo}" = "_" ]; then
127             image={container}:{tag}
128           elif [ "{port}" = "None" ]; then
129             image={repo}/{container}:{tag}
130           else
131             image={repo}:{port}/{container}:{tag}
132           fi
133           sudo docker rmi $image || true
134
135 - scm:
136     name: xtesting-scm
137     scm:
138       - git:
139           url: https://gerrit.opnfv.org/gerrit/functest-xtesting
140           refspec: '+refs/changes/*:refs/changes/*'
141           branches:
142             - '{ref}'
143
144 - job-template:
145     name: 'xtesting-{repo}-{container}-{tag}-pull'
146     parameters:
147       - xtesting-slave:
148           slave: '{slave}'
149     builders:
150       - xtesting-pull-containers:
151           <<: *xtesting-containers
152
153 - project:
154     name: 'xtesting-opnfv-xtesting-pull'
155     <<: *xtesting-params
156     container: 'xtesting'
157     jobs:
158       - 'xtesting-{repo}-{container}-{tag}-pull'
159
160 - job-template:
161     name: 'xtesting-{repo}-{container}-{tag}-rmi'
162     parameters:
163       - xtesting-slave:
164           slave: '{slave}'
165     builders:
166       - xtesting-remove-images:
167           <<: *xtesting-containers
168
169 - project:
170     name: 'xtesting-opnfv-xtesting-rmi'
171     <<: *xtesting-params
172     container: 'xtesting'
173     jobs:
174       - 'xtesting-{repo}-{container}-{tag}-rmi'
175
176 - job-template:
177     name: 'xtesting-{repo}-{container}-{tag}-{test}-run'
178     parameters:
179       - xtesting-slave:
180           slave: '{slave}'
181       - xtesting-build_tag:
182           build_tag: ''
183     builders:
184       - xtesting-run-containers:
185           <<: *xtesting-run-containers
186
187 - project:
188     name: 'xtesting-opnfv-xtesting'
189     <<: *xtesting-params
190     container: 'xtesting'
191     test:
192       - first
193       - second
194       - third
195       - fourth
196       - fifth
197       - sixth
198     exclude:
199       - tag: hunter
200         test: sixth
201       - tag: iruya
202         test: sixth
203     jobs:
204       - 'xtesting-{repo}-{container}-{tag}-{test}-run'
205
206 - job-template:
207     name: 'xtesting-{tag}-daily'
208     project-type: multijob
209     triggers:
210       - timed: '@daily'
211     parameters:
212       - xtesting-slave:
213           slave: '{slave}'
214       - xtesting-build_tag:
215           build_tag: ''
216     properties:
217       - build-blocker:
218           use-build-blocker: true
219           blocking-level: 'NODE'
220           blocking-jobs:
221             - '^xtesting-{tag}-(daily|check|gate)$'
222     builders:
223       - multijob:
224           name: remove former images
225           projects:
226             - name: 'xtesting-opnfv-xtesting-{tag}-rmi'
227               <<: *xtesting-jobs
228       - multijob:
229           name: pull containers
230           projects:
231             - name: 'xtesting-opnfv-xtesting-{tag}-pull'
232               <<: *xtesting-jobs
233       - multijob:
234           name: opnfv/xtesting:{tag}
235           projects:
236             - name: 'xtesting-opnfv-xtesting-{tag}-first-run'
237               <<: *xtesting-jobs
238             - name: 'xtesting-opnfv-xtesting-{tag}-second-run'
239               <<: *xtesting-jobs
240             - name: 'xtesting-opnfv-xtesting-{tag}-third-run'
241               <<: *xtesting-jobs
242             - name: 'xtesting-opnfv-xtesting-{tag}-fourth-run'
243               <<: *xtesting-jobs
244             - name: 'xtesting-opnfv-xtesting-{tag}-fifth-run'
245               <<: *xtesting-jobs
246             - name: 'xtesting-opnfv-xtesting-{tag}-sixth-run'
247               <<: *xtesting-jobs
248
249 - job-template:
250     name: 'xtesting-{repo}-{container}-{tag}-gate'
251     parameters:
252       - xtesting-slave:
253           slave: '{slave}'
254     scm:
255       - xtesting-scm:
256           ref: $GERRIT_REFSPEC
257     builders:
258       - xtesting-build-containers:
259           <<: *xtesting-build-containers
260           ref: $GERRIT_REFSPEC
261
262 - job-template:
263     name: 'xtesting-{repo}-{container}-{tag}-check'
264     parameters:
265       - xtesting-slave:
266           slave: '{slave}'
267       - xtesting-branch:
268           branch: '{branch}'
269     scm:
270       - xtesting-scm:
271           ref: $branch
272     builders:
273       - xtesting-build-containers:
274           <<: *xtesting-build-containers
275           ref: $branch
276
277 - project:
278     name: 'xtesting-_-alpine-3.10-rmi'
279     repo: _
280     port:
281     container: alpine
282     tag: '3.10'
283     slave: master
284     jobs:
285       - 'xtesting-{repo}-{container}-{tag}-rmi'
286
287 - project:
288     name: 'xtesting-_-alpine-3.10-pull'
289     repo: _
290     port:
291     container: alpine
292     tag: '3.10'
293     slave: master
294     jobs:
295       - 'xtesting-{repo}-{container}-{tag}-pull'
296
297 - project:
298     name: xtesting-opnfv-xtesting-{tag}-build
299     <<: *xtesting-params
300     container: xtesting
301     ref_arg: BRANCH
302     path: docker
303     jobs:
304       - 'xtesting-{repo}-{container}-{tag}-gate'
305       - 'xtesting-{repo}-{container}-{tag}-check'
306
307 - job-template:
308     name: 'xtesting-{tag}-check'
309     project-type: multijob
310     parameters:
311       - xtesting-slave:
312           slave: '{slave}'
313       - xtesting-build_tag:
314           build_tag: ''
315       - xtesting-branch:
316           branch: '{branch}'
317     properties:
318       - build-blocker:
319           use-build-blocker: true
320           blocking-level: 'NODE'
321           blocking-jobs:
322             - '^xtesting-{tag}-(daily|check|gate)$'
323     builders:
324       - multijob:
325           name: remove former images
326           projects:
327             - name: 'xtesting-opnfv-xtesting-{tag}-rmi'
328               <<: *xtesting-jobs
329       - multijob:
330           name: remove dependencies
331           projects:
332             - name: 'xtesting-_-alpine-3.10-rmi'
333               <<: *xtesting-jobs
334       - multijob:
335           name: pull dependencies
336           projects:
337             - name: 'xtesting-_-alpine-3.10-pull'
338               <<: *xtesting-jobs
339       - multijob:
340           name: opnfv/xtesting
341           projects:
342             - name: 'xtesting-opnfv-xtesting-{tag}-check'
343               <<: *xtesting-jobs
344       - multijob:
345           name: opnfv/xtesting:{tag}
346           projects:
347             - name: 'xtesting-opnfv-xtesting-{tag}-first-run'
348               <<: *xtesting-jobs
349             - name: 'xtesting-opnfv-xtesting-{tag}-second-run'
350               <<: *xtesting-jobs
351             - name: 'xtesting-opnfv-xtesting-{tag}-third-run'
352               <<: *xtesting-jobs
353             - name: 'xtesting-opnfv-xtesting-{tag}-fourth-run'
354               <<: *xtesting-jobs
355             - name: 'xtesting-opnfv-xtesting-{tag}-fifth-run'
356               <<: *xtesting-jobs
357             - name: 'xtesting-opnfv-xtesting-{tag}-sixth-run'
358               <<: *xtesting-jobs
359
360 - trigger:
361     name: xtesting-patchset-created
362     triggers:
363       - gerrit:
364           server-name: 'gerrit.opnfv.org'
365           trigger-on:
366             - patchset-created-event
367             - comment-added-contains-event:
368                 comment-contains-value: 'recheck'
369             - comment-added-contains-event:
370                 comment-contains-value: 'reverify'
371           projects:
372             - project-compare-type: 'ANT'
373               project-pattern: 'functest-xtesting'
374               branches:
375                 - branch-compare-type: 'ANT'
376                   branch-pattern: '**/{branch}'
377           skip-vote:
378             successful: false
379             failed: false
380             unstable: false
381             notbuilt: false
382
383 - job-template:
384     name: 'xtesting-{tag}-gate'
385     project-type: multijob
386     triggers:
387       - xtesting-patchset-created:
388           branch: '{branch}'
389     parameters:
390       - xtesting-slave:
391           slave: '{slave}'
392       - xtesting-build_tag:
393           build_tag: ''
394     properties:
395       - build-blocker:
396           use-build-blocker: true
397           blocking-level: 'NODE'
398           blocking-jobs:
399             - '^xtesting-{tag}-(daily|check|gate)$'
400     builders:
401       - multijob:
402           name: remove former images
403           projects:
404             - name: 'xtesting-opnfv-xtesting-{tag}-rmi'
405               <<: *xtesting-jobs
406       - multijob:
407           name: remove dependencies
408           projects:
409             - name: 'xtesting-_-alpine-3.10-rmi'
410               <<: *xtesting-jobs
411       - multijob:
412           name: pull dependencies
413           projects:
414             - name: 'xtesting-_-alpine-3.10-pull'
415               <<: *xtesting-jobs
416       - multijob:
417           name: opnfv/xtesting
418           projects:
419             - name: 'xtesting-opnfv-xtesting-{tag}-gate'
420               <<: *xtesting-jobs
421       - multijob:
422           name: opnfv/xtesting:{tag}
423           projects:
424             - name: 'xtesting-opnfv-xtesting-{tag}-first-run'
425               <<: *xtesting-jobs
426             - name: 'xtesting-opnfv-xtesting-{tag}-second-run'
427               <<: *xtesting-jobs
428             - name: 'xtesting-opnfv-xtesting-{tag}-third-run'
429               <<: *xtesting-jobs
430             - name: 'xtesting-opnfv-xtesting-{tag}-fourth-run'
431               <<: *xtesting-jobs
432             - name: 'xtesting-opnfv-xtesting-{tag}-fifth-run'
433               <<: *xtesting-jobs
434             - name: 'xtesting-opnfv-xtesting-{tag}-sixth-run'
435               <<: *xtesting-jobs
436
437 - project:
438     name: 'xtesting'
439     <<: *xtesting-params
440     jobs:
441       - 'xtesting-{tag}-daily'
442       - 'xtesting-{tag}-check'
443       - 'xtesting-{tag}-gate'
444
445 - view:
446     name: xtesting
447     view-type: list
448     columns:
449       - status
450       - weather
451       - job
452       - last-success
453       - last-failure
454       - last-duration
455     regex: ^xtesting-[a-z]+-(daily|check|gate)$