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