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