Publish Xtesting Xena 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       - 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
370 - project:
371     name: 'xtesting-daily'
372     <<: *xtesting-params
373     jobs:
374       - 'xtesting-{tag}-daily'
375
376 - view:
377     name: xtesting
378     view-type: list
379     columns:
380       - status
381       - weather
382       - job
383       - last-success
384       - last-failure
385       - last-duration
386     regex: ^xtesting-[a-z0-9.]+-daily$
387
388 - xtesting-build-containers: &xtesting-build-containers
389     name: 'xtesting-build-containers'
390     <<: *xtesting-containers
391     ref_arg: '{ref_arg}'
392     path: '{path}'
393     build_args: '{build_args}'
394     from: '{from}'
395
396 - builder:
397     name: xtesting-build-containers
398     builders:
399       - shell: |
400           set +x
401           if [ "{repo}" = "_" ]; then
402             image={container}:{tag}
403           elif [ "{port}" = "None" ]; then
404             image={repo}/{container}:{tag}
405           else
406             image={repo}:{port}/{container}:{tag}
407           fi
408           build_args=""
409           if [ "{build_args}" != "None" ]; then
410             for i in $(echo {build_args} | tr -d '[]' |sed "s/, / /g" ); \
411               do build_args="--build-arg $i $build_args"; done
412           fi
413           if [ "{ref_arg}" != "None" ]; then
414             build_args="$build_args --build-arg {ref_arg}={ref}"
415           fi
416           cd {path}
417           if [ "{from}" != "None" ]; then
418               sed -i {from} Dockerfile
419           fi
420           sudo docker build $build_args \
421             --pull=false --no-cache --force-rm=true \
422             -t $image .
423
424 - scm:
425     name: xtesting-scm
426     scm:
427       - git:
428           url: 'https://gerrit.opnfv.org/gerrit/functest-xtesting'
429           refspec: '+refs/heads/*:refs/remotes/origin/* +refs/changes/*:refs/changes/*'
430           branches:
431             - '{ref}'
432
433 - xtesting-dep: &xtesting-dep
434     name: 'xtesting-containers'
435     repo: '{repo}'
436     port: '{port}'
437     tag: '{tag}'
438     dependency: '{dependency}'
439
440 - builder:
441     name: xtesting-pull-dep-images
442     builders:
443       - shell: |
444           set +x
445           if [ "_" = "_" ]; then
446             image=alpine:{dependency}
447           elif [ "" = "None" ]; then
448             image=_/alpine:{dependency}
449           else
450             image=_:/alpine:{dependency}
451           fi
452           sudo docker pull $image || true
453
454 - builder:
455     name: xtesting-remove-dep-images
456     builders:
457       - shell: |
458           set +x
459           if [ "_" = "_" ]; then
460             image=alpine:{dependency}
461           elif [ "" = "None" ]; then
462             image=_/alpine:{dependency}
463           else
464             image=_:/alpine:{dependency}
465           fi
466           sudo docker rmi $image || true
467
468 - job-template:
469     name: 'xtesting-{repo}-{tag}-dep-pull'
470     parameters:
471       - xtesting-slave:
472           slave: '{slave}'
473     builders:
474       - xtesting-pull-dep-images:
475           <<: *xtesting-dep
476
477 - project:
478     name: 'xtesting-{repo}-{tag}-dep-pull'
479     <<: *xtesting-params
480     jobs:
481       - 'xtesting-{repo}-{tag}-dep-pull'
482
483 - job-template:
484     name: 'xtesting-{repo}-{tag}-dep-rmi'
485     parameters:
486       - xtesting-slave:
487           slave: '{slave}'
488     builders:
489       - xtesting-remove-dep-images:
490           <<: *xtesting-dep
491
492 - project:
493     name: 'xtesting-{repo}-{tag}-dep-rmi'
494     <<: *xtesting-params
495     jobs:
496       - 'xtesting-{repo}-{tag}-dep-rmi'
497
498 - builder:
499     name: xtesting-tox
500     builders:
501       - shell: |
502           set +x
503           sudo apt-get update && \
504           sudo DEBIAN_FRONTEND=noninteractive apt-get dist-upgrade -y
505           sudo DEBIAN_FRONTEND=noninteractive \
506           apt-get install software-properties-common gpg -y
507           sudo add-apt-repository -y ppa:deadsnakes/ppa
508           sudo apt-get update && sudo DEBIAN_FRONTEND=noninteractive \
509           apt-get install \
510             python3.9 python3.9-dev python3.9-distutils \
511             python3.8 python3.8-dev python3.8-distutils \
512             python3.7 python3.7-dev python3.6 python3.6-dev \
513             python python-dev python3-pip enchant -y
514           sudo pip3 install tox tox-pip-version
515
516           tox
517
518 - job-template:
519     name: 'xtesting-{tag}-tox'
520     scm:
521       - xtesting-scm:
522           ref: $GERRIT_REFSPEC
523     triggers:
524       - xtesting-patchset-created:
525           branch: '{branch}'
526     parameters:
527       - xtesting-slave:
528           slave: '{slave}'
529     builders:
530       - xtesting-tox:
531
532 - project:
533     name: xtesting-tox
534     <<: *xtesting-params
535     jobs:
536       - 'xtesting-{tag}-tox'
537
538 - job-template:
539     name: 'xtesting-{repo}-{container}-{tag}-gate'
540     parameters:
541       - xtesting-slave:
542           slave: '{slave}'
543     scm:
544       - xtesting-scm:
545           ref: $GERRIT_REFSPEC
546     builders:
547       - xtesting-build-containers:
548           <<: *xtesting-build-containers
549           ref: $GERRIT_REFSPEC
550           build_args: '{build_args}'
551
552 - project:
553     name: xtesting-opnfv-xtesting-{tag}-gate
554     <<: *xtesting-params
555     container: xtesting
556     ref_arg: BRANCH
557     path: docker/core
558     jobs:
559       - 'xtesting-{repo}-{container}-{tag}-gate'
560
561 - project:
562     name: xtesting-opnfv-xtesting-mts-{tag}-gate
563     <<: *xtesting-params
564     container: xtesting-mts
565     ref_arg: BRANCH
566     path: docker/mts
567     jobs:
568       - 'xtesting-{repo}-{container}-{tag}-gate'
569
570 - trigger:
571     name: xtesting-patchset-created
572     triggers:
573       - gerrit:
574           trigger-on:
575             - patchset-created-event
576             - comment-added-contains-event:
577                 comment-contains-value: 'recheck'
578             - comment-added-contains-event:
579                 comment-contains-value: 'reverify'
580           projects:
581             - project-compare-type: 'ANT'
582               project-pattern: 'functest-xtesting'
583               branches:
584                 - branch-compare-type: 'ANT'
585                   branch-pattern: '**/{branch}'
586
587 - job-template:
588     name: 'xtesting-{tag}-review'
589     project-type: multijob
590     triggers:
591       - xtesting-patchset-created:
592           branch: '{branch}'
593     parameters:
594       - xtesting-slave:
595           slave: '{slave}'
596       - xtesting-build_tag:
597           build_tag: ''
598     # PyYAML and yamllint differ here
599     # see https://github.com/yaml/pyyaml/issues/234
600     # yamllint disable rule:indentation
601     properties:
602       - build-blocker:
603           blocking-jobs:
604           - ^xtesting-(pi-)*{tag}-(daily|docker|review)$
605     # yamllint enable rule:indentation
606     builders:
607       - multijob:
608           name: remove former images
609           projects:
610             - name: 'xtesting-opnfv-xtesting-{tag}-rmi'
611               <<: *xtesting-jobs
612             - name: 'xtesting-opnfv-xtesting-mts-{tag}-rmi'
613               <<: *xtesting-jobs
614       - multijob:
615           name: remove dependency
616           projects:
617             - name: 'xtesting-{repo}-{tag}-dep-rmi'
618               <<: *xtesting-jobs
619       - multijob:
620           name: pull dependency
621           projects:
622             - name: 'xtesting-{repo}-{tag}-dep-pull'
623               <<: *xtesting-jobs
624       - multijob:
625           name: opnfv/xtesting
626           projects:
627             - name: 'xtesting-opnfv-xtesting-{tag}-gate'
628               <<: *xtesting-jobs
629       - multijob:
630           name: opnfv/xtesting-mts
631           projects:
632             - name: 'xtesting-opnfv-xtesting-mts-{tag}-gate'
633               <<: *xtesting-jobs
634       - multijob:
635           name: opnfv/xtesting:{tag}
636           projects:
637             - name: 'xtesting-opnfv-xtesting-{tag}-first-run'
638               <<: *xtesting-jobs
639             - name: 'xtesting-opnfv-xtesting-{tag}-second-run'
640               <<: *xtesting-jobs
641             - name: 'xtesting-opnfv-xtesting-{tag}-third-run'
642               <<: *xtesting-jobs
643             - name: 'xtesting-opnfv-xtesting-{tag}-fourth-run'
644               <<: *xtesting-jobs
645             - name: 'xtesting-opnfv-xtesting-{tag}-fifth-run'
646               <<: *xtesting-jobs
647             - name: 'xtesting-opnfv-xtesting-{tag}-sixth-run'
648               <<: *xtesting-jobs
649             - name: 'xtesting-opnfv-xtesting-{tag}-eighth-run'
650               <<: *xtesting-jobs
651       - multijob:
652           name: opnfv/xtesting-mts:{tag}
653           projects:
654             - name: 'xtesting-opnfv-xtesting-mts-{tag}-seventh-run'
655               <<: *xtesting-jobs
656
657 - project:
658     name: 'xtesting-review'
659     <<: *xtesting-params
660     jobs:
661       - 'xtesting-{tag}-review'
662
663 - view:
664     name: xtesting-review
665     view-type: list
666     columns:
667       - status
668       - weather
669       - job
670       - last-success
671       - last-failure
672       - last-duration
673     regex: ^xtesting-[a-z0-9.]+-review$
674
675 - view:
676     name: xtesting-tox
677     view-type: list
678     columns:
679       - status
680       - weather
681       - job
682       - last-success
683       - last-failure
684       - last-duration
685     regex: ^xtesting-[a-z0-9.]+-tox$
686
687 - builder:
688     name: xtesting-push-containers
689     builders:
690       - shell: |
691           set +x
692           if [ "{repo}" = "_" ]; then
693             image={container}:{tag}
694           elif [ "{port}" = "None" ]; then
695             image={repo}/{container}:{tag}
696           else
697             image={repo}:{port}/{container}:{tag}
698           fi
699           sudo docker push $image
700
701 - trigger:
702     name: xtesting-commit
703     triggers:
704       - pollscm:
705           cron: "*/30 * * * *"
706
707 - job-template:
708     name: 'xtesting-{repo}-{container}-{tag}-build'
709     parameters:
710       - xtesting-slave:
711           slave: '{slave}'
712     scm:
713       - xtesting-scm:
714           ref: '{branch}'
715     builders:
716       - xtesting-build-containers:
717           <<: *xtesting-build-containers
718           ref: '{branch}'
719           build_args: '{build_args}'
720       - xtesting-push-containers:
721           <<: *xtesting-build-containers
722           ref: '{branch}'
723
724 - project:
725     name: xtesting-opnfv-xtesting-{tag}-build
726     <<: *xtesting-params
727     container: xtesting
728     ref_arg: BRANCH
729     path: docker/core
730     jobs:
731       - 'xtesting-{repo}-{container}-{tag}-build'
732
733 - project:
734     name: xtesting-opnfv-xtesting-mts-{tag}-build
735     <<: *xtesting-params
736     container: xtesting-mts
737     ref_arg: BRANCH
738     path: docker/mts
739     jobs:
740       - 'xtesting-{repo}-{container}-{tag}-build'
741
742 - job-template:
743     name: 'xtesting-{tag}-docker'
744     project-type: multijob
745     triggers:
746       - xtesting-commit
747     scm:
748       - xtesting-scm:
749           ref: '{branch}'
750     parameters:
751       - xtesting-slave:
752           slave: '{slave}'
753     # PyYAML and yamllint differ here
754     # see https://github.com/yaml/pyyaml/issues/234
755     # yamllint disable rule:indentation
756     properties:
757       - build-blocker:
758           blocking-jobs:
759           - ^xtesting-(pi-)*{tag}-(daily|docker|review)$
760     # yamllint enable rule:indentation
761     builders:
762       - multijob:
763           name: remove dependency
764           projects:
765             - name: 'xtesting-{repo}-{tag}-dep-rmi'
766               <<: *xtesting-jobs
767       - multijob:
768           name: pull dependency
769           projects:
770             - name: 'xtesting-{repo}-{tag}-dep-pull'
771               <<: *xtesting-jobs
772       - multijob:
773           name: opnfv/xtesting
774           projects:
775             - name: 'xtesting-opnfv-xtesting-{tag}-build'
776               <<: *xtesting-jobs
777       - multijob:
778           name: opnfv/xtesting-mts
779           projects:
780             - name: 'xtesting-opnfv-xtesting-mts-{tag}-build'
781               <<: *xtesting-jobs
782
783 - builder:
784     name: xtesting-trivy
785     builders:
786       - shell: |
787           sudo apt-get update && sudo DEBIAN_FRONTEND=noninteractive \
788           apt-get install curl -y
789
790           curl -sfL https://raw.githubusercontent.com/aquasecurity/trivy/main/contrib/install.sh | sudo sh -s -- -b .
791           if [ "{repo}" = "_" ]; then
792             image={container}:{tag}
793           elif [ "{port}" = "None" ]; then
794             image={repo}/{container}:{tag}
795           else
796             image={repo}:{port}/{container}:{tag}
797           fi
798           ./trivy --exit-code 1 $image
799
800 - job-template:
801     name: 'xtesting-{repo}-{container}-{tag}-trivy'
802     triggers:
803       - timed: '@daily'
804     parameters:
805       - xtesting-slave:
806           slave: '{slave}'
807     builders:
808       - xtesting-trivy:
809           <<: *xtesting-containers
810
811 - project:
812     name: 'xtesting-opnfv-xtesting-trivy'
813     <<: *xtesting-params
814     container: 'xtesting'
815     jobs:
816       - 'xtesting-{repo}-{container}-{tag}-trivy'
817
818 - project:
819     name: 'xtesting-opnfv-xtesting-mts-trivy'
820     <<: *xtesting-params
821     container: 'xtesting-mts'
822     jobs:
823       - 'xtesting-{repo}-{container}-{tag}-trivy'
824
825 - project:
826     name: 'xtesting'
827     <<: *xtesting-params
828     jobs:
829       - 'xtesting-{tag}-docker'
830
831 - view:
832     name: xtesting-docker
833     view-type: list
834     columns:
835       - status
836       - weather
837       - job
838       - last-success
839       - last-failure
840       - last-duration
841     regex: ^xtesting-[a-z0-9.]+-docker$
842
843 - view:
844     name: xtesting-trivy
845     view-type: list
846     columns:
847       - status
848       - weather
849       - job
850       - last-success
851       - last-failure
852       - last-duration
853     regex: (?!xtesting-pi)^xtesting-[a-z-0-9.]+-trivy$