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