Prepare Functest Leguer gates
[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       - leguer:
15           branch: stable/leguer
16           slave: lf-virtual1
17       - kali:
18           branch: stable/kali
19           slave: lf-virtual1
20       - jerma:
21           branch: stable/jerma
22           slave: lf-virtual1
23       - iruya:
24           branch: stable/iruya
25           slave: lf-virtual1
26       - hunter:
27           branch: stable/hunter
28           slave: lf-virtual1
29       - arm64-latest:
30           branch: master
31           slave: lf-virtual1
32       - arm64-leguer:
33           branch: stable/leguer
34           slave: lf-virtual1
35       - arm64-kali:
36           branch: stable/kali
37           slave: lf-virtual1
38       - arm64-jerma:
39           branch: stable/jerma
40           slave: lf-virtual1
41       - arm64-iruya:
42           branch: stable/iruya
43           slave: lf-virtual1
44       - arm64-hunter:
45           branch: stable/hunter
46           slave: lf-virtual1
47
48 - parameter:
49     name: xtesting-slave
50     parameters:
51       - label:
52           name: slave
53           default: '{slave}'
54
55 - parameter:
56     name: xtesting-build_tag
57     parameters:
58       - random-string:
59           name: build_tag
60
61 - parameter:
62     name: xtesting-branch
63     parameters:
64       - string:
65           name: branch
66           default: '{branch}'
67
68 - parameter:
69     name: xtesting-DEBUG
70     parameters:
71       - string:
72           name: DEBUG
73           default: 'true'
74
75 - xtesting-containers: &xtesting-containers
76     name: 'xtesting-containers'
77     repo: '{repo}'
78     port: '{port}'
79     container: '{container}'
80     tag: '{tag}'
81
82 - xtesting-run-containers: &xtesting-run-containers
83     name: 'xtesting-run-containers'
84     <<: *xtesting-containers
85     test: '{test}'
86     privileged: '{privileged}'
87     network: '{network}'
88
89 - builder:
90     name: xtesting-pull-containers
91     builders:
92       - shell: |
93           set +x
94           if [ "{repo}" = "_" ]; then
95             image={container}:{tag}
96           elif [ "{port}" = "None" ]; then
97             image={repo}/{container}:{tag}
98           else
99             image={repo}:{port}/{container}:{tag}
100           fi
101           sudo docker pull $image
102
103 - builder:
104     name: xtesting-run-containers
105     builders:
106       - shell: |
107           set +x
108           [ ! -z "$WORKSPACE" ] && sudo rm -rf $WORKSPACE/* || true
109           if [ "{repo}" = "_" ]; then
110             image={container}:{tag}
111           elif [ "{port}" = "None" ]; then
112             image={repo}/{container}:{tag}
113           else
114             image={repo}:{port}/{container}:{tag}
115           fi
116           sudo docker run --rm \
117             --privileged={privileged} \
118             --network={network} \
119             -e S3_ENDPOINT_URL=https://storage.googleapis.com \
120             -e S3_DST_URL=s3://artifacts.opnfv.org/xtesting/$BUILD_TAG/$JOB_NAME-$BUILD_ID \
121             -e HTTP_DST_URL=http://artifacts.opnfv.org/xtesting/$BUILD_TAG/$JOB_NAME-$BUILD_ID \
122             -e TEST_DB_URL=http://testresults.opnfv.org/test/api/v1/results \
123             -e TEST_DB_EXT_URL=http://testresults.opnfv.org/test/api/v1/results \
124             -e NODE_NAME=$slave \
125             -e BUILD_TAG=$BUILD_TAG \
126             -v $WORKSPACE/../$JOB_NAME/results:/var/lib/xtesting/results \
127             -e DEBUG=$DEBUG \
128             -v /home/opnfv/xtesting/.boto:/root/.boto \
129             $image run_tests -t {test} -p -r
130
131 - builder:
132     name: xtesting-remove-images
133     builders:
134       - shell: |
135           set +x
136           if [ "{repo}" = "_" ]; then
137             image={container}:{tag}
138           elif [ "{port}" = "None" ]; then
139             image={repo}/{container}:{tag}
140           else
141             image={repo}:{port}/{container}:{tag}
142           fi
143           sudo docker rmi $image || true
144
145 - xtesting-build-containers: &xtesting-build-containers
146     name: 'xtesting-build-containers'
147     <<: *xtesting-containers
148     ref_arg: '{ref_arg}'
149     path: '{path}'
150
151 - builder:
152     name: xtesting-build-containers
153     builders:
154       - shell: |
155           set +x
156           if [ "{repo}" = "_" ]; then
157             image={container}:{tag}
158           elif [ "{port}" = "None" ]; then
159             image={repo}/{container}:{tag}
160           else
161             image={repo}:{port}/{container}:{tag}
162           fi
163           if [ "{ref_arg}" = "None" ]; then
164             build_arg=""
165           else
166             build_arg="--build-arg {ref_arg}={ref}"
167           fi
168           case {tag} in
169           *latest|*leguer)
170             cd {path};;
171           *)
172             cd docker;;
173           esac
174           sudo docker build $build_arg \
175             --pull=false --no-cache --force-rm=true \
176             -t $image .
177
178 - scm:
179     name: xtesting-scm
180     scm:
181       - git:
182           url: https://gerrit.opnfv.org/gerrit/functest-xtesting
183           refspec: '+refs/changes/*:refs/changes/*'
184           branches:
185             - '{ref}'
186
187 - job-template:
188     name: 'xtesting-{repo}-{container}-{tag}-pull'
189     parameters:
190       - xtesting-slave:
191           slave: '{slave}'
192     builders:
193       - xtesting-pull-containers:
194           <<: *xtesting-containers
195
196 - project:
197     name: 'xtesting-opnfv-xtesting-pull'
198     <<: *xtesting-params
199     container: 'xtesting'
200     jobs:
201       - 'xtesting-{repo}-{container}-{tag}-pull'
202
203 - project:
204     name: 'xtesting-opnfv-xtesting-mts-pull'
205     <<: *xtesting-params
206     container: 'xtesting-mts'
207     exclude:
208       - tag: hunter
209       - tag: iruya
210       - tag: jerma
211       - tag: kali
212       - tag: arm64-hunter
213       - tag: arm64-iruya
214       - tag: arm64-jerma
215       - tag: arm64-kali
216     jobs:
217       - 'xtesting-{repo}-{container}-{tag}-pull'
218
219 - job-template:
220     name: 'xtesting-{repo}-{container}-{tag}-rmi'
221     parameters:
222       - xtesting-slave:
223           slave: '{slave}'
224     builders:
225       - xtesting-remove-images:
226           <<: *xtesting-containers
227
228 - project:
229     name: 'xtesting-opnfv-xtesting-rmi'
230     <<: *xtesting-params
231     container: 'xtesting'
232     jobs:
233       - 'xtesting-{repo}-{container}-{tag}-rmi'
234
235 - project:
236     name: 'xtesting-opnfv-xtesting-mts-rmi'
237     <<: *xtesting-params
238     container: 'xtesting-mts'
239     exclude:
240       - tag: hunter
241       - tag: iruya
242       - tag: jerma
243       - tag: kali
244       - tag: arm64-hunter
245       - tag: arm64-iruya
246       - tag: arm64-jerma
247       - tag: arm64-kali
248     jobs:
249       - 'xtesting-{repo}-{container}-{tag}-rmi'
250
251 - job-template:
252     name: 'xtesting-{repo}-{container}-{tag}-{test}-run'
253     parameters:
254       - xtesting-slave:
255           slave: '{slave}'
256       - xtesting-build_tag:
257           build_tag: ''
258       - xtesting-DEBUG:
259           DEBUG: 'true'
260     builders:
261       - xtesting-run-containers:
262           <<: *xtesting-run-containers
263
264 - project:
265     name: 'xtesting-opnfv-xtesting'
266     <<: *xtesting-params
267     container: 'xtesting'
268     test:
269       - first
270       - second
271       - third
272       - fourth
273       - fifth
274       - sixth
275     exclude:
276       - tag: hunter
277         test: sixth
278       - tag: iruya
279         test: sixth
280       - tag: arm64-hunter
281         test: sixth
282       - tag: arm64-iruya
283         test: sixth
284     privileged: 'false'
285     network: bridge
286     jobs:
287       - 'xtesting-{repo}-{container}-{tag}-{test}-run'
288
289 - project:
290     name: 'xtesting-opnfv-xtesting-mts'
291     <<: *xtesting-params
292     container: 'xtesting-mts'
293     test:
294       - seventh
295     exclude:
296       - tag: hunter
297         test: seventh
298       - tag: iruya
299         test: seventh
300       - tag: jerma
301         test: seventh
302       - tag: kali
303         test: seventh
304       - tag: arm64-hunter
305         test: seventh
306       - tag: arm64-iruya
307         test: seventh
308       - tag: arm64-jerma
309         test: seventh
310       - tag: arm64-kali
311         test: seventh
312     privileged: 'false'
313     network: bridge
314     jobs:
315       - 'xtesting-{repo}-{container}-{tag}-{test}-run'
316
317 - builder:
318     name: xtesting-zip
319     builders:
320       - shell: |
321           set +x
322           [ ! -z "$WORKSPACE" ] && sudo rm -rf $WORKSPACE/* || true
323           if [ "{repo}" = "_" ]; then
324             image={container}:{tag}
325           elif [ "{port}" = "None" ]; then
326             image={repo}/{container}:{tag}
327           else
328             image={repo}:{port}/{container}:{tag}
329           fi
330           sudo docker run --rm \
331             -e S3_ENDPOINT_URL=https://storage.googleapis.com \
332             -e S3_DST_URL=s3://artifacts.opnfv.org/xtesting \
333             -e HTTP_DST_URL=http://artifacts.opnfv.org/xtesting \
334             -e TEST_DB_URL=http://testresults.opnfv.org/test/api/v1/results \
335             -e TEST_DB_EXT_URL=http://testresults.opnfv.org/test/api/v1/results \
336             -e BUILD_TAG=$BUILD_TAG \
337             -v $WORKSPACE/../$JOB_NAME/results:/var/lib/xtesting/results \
338             -e DEBUG=$DEBUG \
339             -v /home/opnfv/xtesting/.boto:/root/.boto \
340             $image zip_campaign
341
342 - job-template:
343     name: 'xtesting-{tag}-zip'
344     parameters:
345       - xtesting-slave:
346           slave: '{slave}'
347       - xtesting-build_tag:
348           build_tag: ''
349       - xtesting-DEBUG:
350           DEBUG: 'true'
351     builders:
352       - xtesting-zip:
353           <<: *xtesting-containers
354
355 - project:
356     name: 'xtesting-{tag}-zip'
357     <<: *xtesting-params
358     container: 'xtesting'
359     jobs:
360       - 'xtesting-{tag}-zip'
361
362 - job-template:
363     name: 'xtesting-{tag}-daily'
364     project-type: multijob
365     triggers:
366       - timed: '@daily'
367     parameters:
368       - xtesting-slave:
369           slave: '{slave}'
370       - xtesting-build_tag:
371           build_tag: ''
372       - xtesting-DEBUG:
373           DEBUG: 'true'
374     properties:
375       - build-blocker:
376           use-build-blocker: true
377           blocking-level: 'NODE'
378           blocking-jobs:
379             - '^xtesting-{tag}-(daily|check|gate)$'
380     builders:
381       - multijob:
382           name: remove former images
383           projects:
384             - name: 'xtesting-opnfv-xtesting-{tag}-rmi'
385               <<: *xtesting-jobs
386             - name: 'xtesting-opnfv-xtesting-mts-{tag}-rmi'
387               <<: *xtesting-jobs
388       - multijob:
389           name: pull containers
390           projects:
391             - name: 'xtesting-opnfv-xtesting-{tag}-pull'
392               <<: *xtesting-jobs
393             - name: 'xtesting-opnfv-xtesting-mts-{tag}-pull'
394               <<: *xtesting-jobs
395       - multijob:
396           name: opnfv/xtesting:{tag}
397           projects:
398             - name: 'xtesting-opnfv-xtesting-{tag}-first-run'
399               <<: *xtesting-jobs
400             - name: 'xtesting-opnfv-xtesting-{tag}-second-run'
401               <<: *xtesting-jobs
402             - name: 'xtesting-opnfv-xtesting-{tag}-third-run'
403               <<: *xtesting-jobs
404             - name: 'xtesting-opnfv-xtesting-{tag}-fourth-run'
405               <<: *xtesting-jobs
406             - name: 'xtesting-opnfv-xtesting-{tag}-fifth-run'
407               <<: *xtesting-jobs
408             - name: 'xtesting-opnfv-xtesting-{tag}-sixth-run'
409               <<: *xtesting-jobs
410       - multijob:
411           name: opnfv/xtesting-mts:{tag}
412           projects:
413             - name: 'xtesting-opnfv-xtesting-mts-{tag}-seventh-run'
414               <<: *xtesting-jobs
415       - multijob:
416           name: dump all campaign data
417           projects:
418             - name: 'xtesting-{tag}-zip'
419               <<: *xtesting-jobs
420
421 - job-template:
422     name: 'xtesting-{repo}-{container}-{tag}-gate'
423     parameters:
424       - xtesting-slave:
425           slave: '{slave}'
426     scm:
427       - xtesting-scm:
428           ref: $GERRIT_REFSPEC
429     builders:
430       - xtesting-build-containers:
431           <<: *xtesting-build-containers
432           ref: $GERRIT_REFSPEC
433
434 - job-template:
435     name: 'xtesting-{repo}-{container}-{tag}-check'
436     parameters:
437       - xtesting-slave:
438           slave: '{slave}'
439       - xtesting-branch:
440           branch: '{branch}'
441     scm:
442       - xtesting-scm:
443           ref: $branch
444     builders:
445       - xtesting-build-containers:
446           <<: *xtesting-build-containers
447           ref: $branch
448
449 - project:
450     name: 'xtesting-_-alpine-3.12-rmi'
451     repo: _
452     port:
453     container: alpine
454     tag: '3.12'
455     slave: master
456     jobs:
457       - 'xtesting-{repo}-{container}-{tag}-rmi'
458
459 - project:
460     name: 'xtesting-_-alpine-3.12-pull'
461     repo: _
462     port:
463     container: alpine
464     tag: '3.12'
465     slave: master
466     exclude:
467       - tag: arm64-hunter
468       - tag: arm64-iruya
469       - tag: arm64-jerma
470       - tag: arm64-kali
471       - tag: arm64-leguer
472       - tag: arm64-latest
473     jobs:
474       - 'xtesting-{repo}-{container}-{tag}-pull'
475
476 - project:
477     name: xtesting-opnfv-xtesting-{tag}-build
478     <<: *xtesting-params
479     container: xtesting
480     ref_arg: BRANCH
481     path: docker/core
482     exclude:
483       - tag: arm64-hunter
484       - tag: arm64-iruya
485       - tag: arm64-jerma
486       - tag: arm64-kali
487       - tag: arm64-leguer
488       - tag: arm64-latest
489     jobs:
490       - 'xtesting-{repo}-{container}-{tag}-gate'
491       - 'xtesting-{repo}-{container}-{tag}-check'
492
493 - project:
494     name: xtesting-opnfv-xtesting-mts-{tag}-build
495     <<: *xtesting-params
496     container: xtesting-mts
497     ref_arg: BRANCH
498     path: docker/mts
499     exclude:
500       - tag: hunter
501       - tag: iruya
502       - tag: jerma
503       - tag: kali
504       - tag: arm64-hunter
505       - tag: arm64-iruya
506       - tag: arm64-jerma
507       - tag: arm64-kali
508       - tag: arm64-leguer
509       - tag: arm64-latest
510     jobs:
511       - 'xtesting-{repo}-{container}-{tag}-gate'
512       - 'xtesting-{repo}-{container}-{tag}-check'
513
514 - job-template:
515     name: 'xtesting-{tag}-check'
516     project-type: multijob
517     parameters:
518       - xtesting-slave:
519           slave: '{slave}'
520       - xtesting-build_tag:
521           build_tag: ''
522       - xtesting-branch:
523           branch: '{branch}'
524       - xtesting-DEBUG:
525           DEBUG: 'true'
526     properties:
527       - build-blocker:
528           use-build-blocker: true
529           blocking-level: 'NODE'
530           blocking-jobs:
531             - '^xtesting-{tag}-(daily|check|gate)$'
532     builders:
533       - multijob:
534           name: remove former images
535           projects:
536             - name: 'xtesting-opnfv-xtesting-{tag}-rmi'
537               <<: *xtesting-jobs
538             - name: 'xtesting-opnfv-xtesting-mts-{tag}-rmi'
539               <<: *xtesting-jobs
540       - multijob:
541           name: remove dependencies
542           projects:
543             - name: 'xtesting-_-alpine-3.12-rmi'
544               <<: *xtesting-jobs
545       - multijob:
546           name: pull dependencies
547           projects:
548             - name: 'xtesting-_-alpine-3.12-pull'
549               <<: *xtesting-jobs
550       - multijob:
551           name: opnfv/xtesting
552           projects:
553             - name: 'xtesting-opnfv-xtesting-{tag}-check'
554               <<: *xtesting-jobs
555       - multijob:
556           name: opnfv/xtesting-mts
557           projects:
558             - name: 'xtesting-opnfv-xtesting-mts-{tag}-check'
559               <<: *xtesting-jobs
560       - multijob:
561           name: opnfv/xtesting:{tag}
562           projects:
563             - name: 'xtesting-opnfv-xtesting-{tag}-first-run'
564               <<: *xtesting-jobs
565             - name: 'xtesting-opnfv-xtesting-{tag}-second-run'
566               <<: *xtesting-jobs
567             - name: 'xtesting-opnfv-xtesting-{tag}-third-run'
568               <<: *xtesting-jobs
569             - name: 'xtesting-opnfv-xtesting-{tag}-fourth-run'
570               <<: *xtesting-jobs
571             - name: 'xtesting-opnfv-xtesting-{tag}-fifth-run'
572               <<: *xtesting-jobs
573             - name: 'xtesting-opnfv-xtesting-{tag}-sixth-run'
574               <<: *xtesting-jobs
575       - multijob:
576           name: opnfv/xtesting-mts:{tag}
577           projects:
578             - name: 'xtesting-opnfv-xtesting-mts-{tag}-seventh-run'
579               <<: *xtesting-jobs
580
581 - trigger:
582     name: xtesting-patchset-created
583     triggers:
584       - gerrit:
585           server-name: 'gerrit.opnfv.org'
586           trigger-on:
587             - patchset-created-event
588             - comment-added-contains-event:
589                 comment-contains-value: 'recheck'
590             - comment-added-contains-event:
591                 comment-contains-value: 'reverify'
592           projects:
593             - project-compare-type: 'ANT'
594               project-pattern: 'functest-xtesting'
595               branches:
596                 - branch-compare-type: 'ANT'
597                   branch-pattern: '**/{branch}'
598           skip-vote:
599             successful: false
600             failed: false
601             unstable: false
602             notbuilt: false
603
604 - job-template:
605     name: 'xtesting-{tag}-gate'
606     project-type: multijob
607     triggers:
608       - xtesting-patchset-created:
609           branch: '{branch}'
610     parameters:
611       - xtesting-slave:
612           slave: '{slave}'
613       - xtesting-build_tag:
614           build_tag: ''
615       - xtesting-DEBUG:
616           DEBUG: 'true'
617     properties:
618       - build-blocker:
619           use-build-blocker: true
620           blocking-level: 'NODE'
621           blocking-jobs:
622             - '^xtesting-{tag}-(daily|check|gate)$'
623     builders:
624       - multijob:
625           name: remove former images
626           projects:
627             - name: 'xtesting-opnfv-xtesting-{tag}-rmi'
628               <<: *xtesting-jobs
629             - name: 'xtesting-opnfv-xtesting-mts-{tag}-rmi'
630               <<: *xtesting-jobs
631       - multijob:
632           name: remove dependencies
633           projects:
634             - name: 'xtesting-_-alpine-3.12-rmi'
635               <<: *xtesting-jobs
636       - multijob:
637           name: pull dependencies
638           projects:
639             - name: 'xtesting-_-alpine-3.12-pull'
640               <<: *xtesting-jobs
641       - multijob:
642           name: opnfv/xtesting
643           projects:
644             - name: 'xtesting-opnfv-xtesting-{tag}-gate'
645               <<: *xtesting-jobs
646       - multijob:
647           name: opnfv/xtesting-mts
648           projects:
649             - name: 'xtesting-opnfv-xtesting-mts-{tag}-gate'
650               <<: *xtesting-jobs
651       - multijob:
652           name: opnfv/xtesting:{tag}
653           projects:
654             - name: 'xtesting-opnfv-xtesting-{tag}-first-run'
655               <<: *xtesting-jobs
656             - name: 'xtesting-opnfv-xtesting-{tag}-second-run'
657               <<: *xtesting-jobs
658             - name: 'xtesting-opnfv-xtesting-{tag}-third-run'
659               <<: *xtesting-jobs
660             - name: 'xtesting-opnfv-xtesting-{tag}-fourth-run'
661               <<: *xtesting-jobs
662             - name: 'xtesting-opnfv-xtesting-{tag}-fifth-run'
663               <<: *xtesting-jobs
664             - name: 'xtesting-opnfv-xtesting-{tag}-sixth-run'
665               <<: *xtesting-jobs
666       - multijob:
667           name: opnfv/xtesting-mts:{tag}
668           projects:
669             - name: 'xtesting-opnfv-xtesting-mts-{tag}-seventh-run'
670               <<: *xtesting-jobs
671
672 - project:
673     name: 'xtesting'
674     <<: *xtesting-params
675     jobs:
676       - 'xtesting-{tag}-daily'
677
678 - project:
679     name: 'xtesting-gate'
680     <<: *xtesting-params
681     exclude:
682       - tag: arm64-hunter
683       - tag: arm64-iruya
684       - tag: arm64-jerma
685       - tag: arm64-kali
686       - tag: arm64-leguer
687       - tag: arm64-latest
688     jobs:
689       - 'xtesting-{tag}-check'
690       - 'xtesting-{tag}-gate'
691
692 - view:
693     name: xtesting
694     view-type: list
695     columns:
696       - status
697       - weather
698       - job
699       - last-success
700       - last-failure
701       - last-duration
702     regex: ^xtesting-(arm.*-|amd64-)*[a-z]+-daily$
703
704 - view:
705     name: xtesting-gate
706     view-type: list
707     columns:
708       - status
709       - weather
710       - job
711       - last-success
712       - last-failure
713       - last-duration
714     regex: ^xtesting-(arm.*-|amd64-)*[a-z]+-gate$