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