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