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