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