07b0eb3a9eac56e374cfb2d3260564ad19ba18b2
[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:/etc/boto.cfg \
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 mkdir -p $WORKSPACE/results
283           sudo chown {uid}:{gid} $WORKSPACE/results
284           sudo docker run --rm \
285             $volumes \
286             $env \
287             -e S3_ENDPOINT_URL=https://storage.googleapis.com \
288             -e S3_DST_URL=s3://artifacts.opnfv.org/xtesting \
289             -e HTTP_DST_URL=http://artifacts.opnfv.org/xtesting \
290             -v /home/opnfv/xtesting/.boto:/etc/boto.cfg \
291             -e TEST_DB_URL=http://testresults.opnfv.org/test/api/v1/results \
292             -e TEST_DB_EXT_URL=http://testresults.opnfv.org/test/api/v1/results \
293             -e BUILD_TAG=$BUILD_TAG \
294             -v $WORKSPACE/../$JOB_NAME/results:/var/lib/xtesting/results \
295             $image zip_campaign
296
297 - job-template:
298     name: 'xtesting-{tag}-zip'
299     parameters:
300       - xtesting-slave:
301           slave: '{slave}'
302       - xtesting-build_tag:
303           build_tag: ''
304     builders:
305       - xtesting-zip:
306           <<: *xtesting-containers
307           volumes: '{volumes}'
308           env: '{env}'
309           uid: '{uid}'
310           gid: '{gid}'
311
312 - project:
313     name: 'xtesting-{tag}-zip'
314     <<: *xtesting-params
315     volumes:
316     env:
317     container: 'xtesting'
318     uid: 1000
319     gid: 1000
320     jobs:
321       - 'xtesting-{tag}-zip'
322
323 - job-template:
324     name: 'xtesting-{tag}-daily'
325     project-type: multijob
326     triggers:
327       - timed: '@daily'
328     parameters:
329       - xtesting-slave:
330           slave: '{slave}'
331       - xtesting-build_tag:
332           build_tag: ''
333     # PyYAML and yamllint differ here
334     # see https://github.com/yaml/pyyaml/issues/234
335     # yamllint disable rule:indentation
336     properties:
337       - build-blocker:
338           blocking-jobs:
339           - ^xtesting-(pi-)*{tag}-(daily|docker|review)$
340     # yamllint enable rule:indentation
341     builders:
342       - multijob:
343           name: remove former images
344           projects:
345             - name: 'xtesting-opnfv-xtesting-{tag}-rmi'
346               <<: *xtesting-jobs
347             - name: 'xtesting-opnfv-xtesting-mts-{tag}-rmi'
348               <<: *xtesting-jobs
349       - multijob:
350           name: pull containers
351           projects:
352             - name: 'xtesting-opnfv-xtesting-{tag}-pull'
353               <<: *xtesting-jobs
354             - name: 'xtesting-opnfv-xtesting-mts-{tag}-pull'
355               <<: *xtesting-jobs
356       - multijob:
357           name: opnfv/xtesting:{tag}
358           projects:
359             - name: 'xtesting-opnfv-xtesting-{tag}-first-run'
360               <<: *xtesting-jobs
361             - name: 'xtesting-opnfv-xtesting-{tag}-second-run'
362               <<: *xtesting-jobs
363             - name: 'xtesting-opnfv-xtesting-{tag}-third-run'
364               <<: *xtesting-jobs
365             - name: 'xtesting-opnfv-xtesting-{tag}-fourth-run'
366               <<: *xtesting-jobs
367             - name: 'xtesting-opnfv-xtesting-{tag}-fifth-run'
368               <<: *xtesting-jobs
369             - name: 'xtesting-opnfv-xtesting-{tag}-sixth-run'
370               <<: *xtesting-jobs
371             - name: 'xtesting-opnfv-xtesting-{tag}-eighth-run'
372               <<: *xtesting-jobs
373       - multijob:
374           name: opnfv/xtesting-mts:{tag}
375           projects:
376             - name: 'xtesting-opnfv-xtesting-mts-{tag}-seventh-run'
377               <<: *xtesting-jobs
378       - multijob:
379           name: dump all campaign data
380           projects:
381             - name: 'xtesting-{tag}-zip'
382               <<: *xtesting-jobs
383     publishers:
384       - email-ext:
385           failure: false
386           first-failure: true
387           fixed: true
388           recipients: cedric.ollivier@orange.com
389
390 - project:
391     name: 'xtesting-daily'
392     <<: *xtesting-params
393     jobs:
394       - 'xtesting-{tag}-daily'
395
396 - view:
397     name: xtesting
398     view-type: list
399     columns:
400       - status
401       - weather
402       - job
403       - last-success
404       - last-failure
405       - last-duration
406     regex: ^xtesting-[a-z0-9.]+-daily$
407
408 - xtesting-build-containers: &xtesting-build-containers
409     name: 'xtesting-build-containers'
410     <<: *xtesting-containers
411     ref_arg: '{ref_arg}'
412     path: '{path}'
413     build_args: '{build_args}'
414     from: '{from}'
415
416 - builder:
417     name: xtesting-build-containers
418     builders:
419       - shell: |
420           set +x
421           if [ "{repo}" = "_" ]; then
422             image={container}:{tag}
423           elif [ "{port}" = "None" ]; then
424             image={repo}/{container}:{tag}
425           else
426             image={repo}:{port}/{container}:{tag}
427           fi
428           build_args=""
429           if [ "{build_args}" != "None" ]; then
430             for i in $(echo {build_args} | tr -d '[]' |sed "s/, / /g" ); \
431               do build_args="--build-arg $i $build_args"; done
432           fi
433           if [ "{ref_arg}" != "None" ]; then
434             build_args="$build_args --build-arg {ref_arg}={ref}"
435           fi
436           cd {path}
437           if [ "{from}" != "None" ]; then
438               sed -i {from} Dockerfile
439           fi
440           sudo docker build $build_args \
441             --pull=false --no-cache --force-rm=true \
442             -t $image .
443
444 - scm:
445     name: xtesting-scm
446     scm:
447       - git:
448           url: 'https://gerrit.opnfv.org/gerrit/functest-xtesting'
449           refspec: '+refs/heads/*:refs/remotes/origin/* +refs/changes/*:refs/changes/*'
450           branches:
451             - '{ref}'
452
453 - xtesting-dep: &xtesting-dep
454     name: 'xtesting-containers'
455     repo: '{repo}'
456     port: '{port}'
457     tag: '{tag}'
458     dependency: '{dependency}'
459
460 - builder:
461     name: xtesting-pull-dep-images
462     builders:
463       - shell: |
464           set +x
465           if [ "_" = "_" ]; then
466             image=alpine:{dependency}
467           elif [ "" = "None" ]; then
468             image=_/alpine:{dependency}
469           else
470             image=_:/alpine:{dependency}
471           fi
472           sudo docker pull $image || true
473
474 - builder:
475     name: xtesting-remove-dep-images
476     builders:
477       - shell: |
478           set +x
479           if [ "_" = "_" ]; then
480             image=alpine:{dependency}
481           elif [ "" = "None" ]; then
482             image=_/alpine:{dependency}
483           else
484             image=_:/alpine:{dependency}
485           fi
486           sudo docker rmi $image || true
487
488 - job-template:
489     name: 'xtesting-{repo}-{tag}-dep-pull'
490     parameters:
491       - xtesting-slave:
492           slave: '{slave}'
493     builders:
494       - xtesting-pull-dep-images:
495           <<: *xtesting-dep
496
497 - project:
498     name: 'xtesting-{repo}-{tag}-dep-pull'
499     <<: *xtesting-params
500     jobs:
501       - 'xtesting-{repo}-{tag}-dep-pull'
502
503 - job-template:
504     name: 'xtesting-{repo}-{tag}-dep-rmi'
505     parameters:
506       - xtesting-slave:
507           slave: '{slave}'
508     builders:
509       - xtesting-remove-dep-images:
510           <<: *xtesting-dep
511
512 - project:
513     name: 'xtesting-{repo}-{tag}-dep-rmi'
514     <<: *xtesting-params
515     jobs:
516       - 'xtesting-{repo}-{tag}-dep-rmi'
517
518 - builder:
519     name: xtesting-tox
520     builders:
521       - shell: |
522           set +x
523           sudo apt-get -o DPkg::Lock::Timeout=300 update && \
524           sudo DEBIAN_FRONTEND=noninteractive apt-get \
525             -o DPkg::Lock::Timeout=300 dist-upgrade -y
526           sudo DEBIAN_FRONTEND=noninteractive \
527           apt-get -o DPkg::Lock::Timeout=300 install software-properties-common gpg -y
528           sudo add-apt-repository -y ppa:deadsnakes/ppa
529           sudo apt-get -o DPkg::Lock::Timeout=300 update && \
530           sudo DEBIAN_FRONTEND=noninteractive apt-get \
531             -o DPkg::Lock::Timeout=300 install \
532             python3.9 python3.9-dev python3.9-distutils \
533             python3.8 python3.8-dev python3.8-distutils \
534             python3.7 python3.7-dev python3.6 python3.6-dev \
535             python python-dev python3-pip enchant -y
536           sudo pip3 install tox tox-pip-version
537
538           tox
539
540 - job-template:
541     name: 'xtesting-{tag}-tox'
542     scm:
543       - xtesting-scm:
544           ref: $GERRIT_REFSPEC
545     triggers:
546       - xtesting-patchset-created:
547           branch: '{branch}'
548     parameters:
549       - xtesting-slave:
550           slave: '{slave}'
551     builders:
552       - xtesting-tox:
553
554 - project:
555     name: xtesting-tox
556     <<: *xtesting-params
557     jobs:
558       - 'xtesting-{tag}-tox'
559
560 - job-template:
561     name: 'xtesting-{repo}-{container}-{tag}-gate'
562     parameters:
563       - xtesting-slave:
564           slave: '{slave}'
565     scm:
566       - xtesting-scm:
567           ref: $GERRIT_REFSPEC
568     builders:
569       - xtesting-build-containers:
570           <<: *xtesting-build-containers
571           ref: $GERRIT_REFSPEC
572           build_args: '{build_args}'
573
574 - project:
575     name: xtesting-opnfv-xtesting-{tag}-gate
576     <<: *xtesting-params
577     container: xtesting
578     ref_arg: BRANCH
579     path: docker/core
580     jobs:
581       - 'xtesting-{repo}-{container}-{tag}-gate'
582
583 - project:
584     name: xtesting-opnfv-xtesting-mts-{tag}-gate
585     <<: *xtesting-params
586     container: xtesting-mts
587     ref_arg: BRANCH
588     path: docker/mts
589     jobs:
590       - 'xtesting-{repo}-{container}-{tag}-gate'
591
592 - trigger:
593     name: xtesting-patchset-created
594     triggers:
595       - gerrit:
596           trigger-on:
597             - patchset-created-event
598             - comment-added-contains-event:
599                 comment-contains-value: 'recheck'
600             - comment-added-contains-event:
601                 comment-contains-value: 'reverify'
602           projects:
603             - project-compare-type: 'ANT'
604               project-pattern: 'functest-xtesting'
605               branches:
606                 - branch-compare-type: 'ANT'
607                   branch-pattern: '**/{branch}'
608
609 - job-template:
610     name: 'xtesting-{tag}-review'
611     project-type: multijob
612     triggers:
613       - xtesting-patchset-created:
614           branch: '{branch}'
615     parameters:
616       - xtesting-slave:
617           slave: '{slave}'
618       - xtesting-build_tag:
619           build_tag: ''
620     # PyYAML and yamllint differ here
621     # see https://github.com/yaml/pyyaml/issues/234
622     # yamllint disable rule:indentation
623     properties:
624       - build-blocker:
625           blocking-jobs:
626           - ^xtesting-(pi-)*{tag}-(daily|docker|review)$
627     # yamllint enable rule:indentation
628     builders:
629       - multijob:
630           name: remove former images
631           projects:
632             - name: 'xtesting-opnfv-xtesting-{tag}-rmi'
633               <<: *xtesting-jobs
634             - name: 'xtesting-opnfv-xtesting-mts-{tag}-rmi'
635               <<: *xtesting-jobs
636       - multijob:
637           name: remove dependency
638           projects:
639             - name: 'xtesting-{repo}-{tag}-dep-rmi'
640               <<: *xtesting-jobs
641       - multijob:
642           name: pull dependency
643           projects:
644             - name: 'xtesting-{repo}-{tag}-dep-pull'
645               <<: *xtesting-jobs
646       - multijob:
647           name: opnfv/xtesting
648           projects:
649             - name: 'xtesting-opnfv-xtesting-{tag}-gate'
650               <<: *xtesting-jobs
651       - multijob:
652           name: opnfv/xtesting-mts
653           projects:
654             - name: 'xtesting-opnfv-xtesting-mts-{tag}-gate'
655               <<: *xtesting-jobs
656       - multijob:
657           name: opnfv/xtesting:{tag}
658           projects:
659             - name: 'xtesting-opnfv-xtesting-{tag}-first-run'
660               <<: *xtesting-jobs
661             - name: 'xtesting-opnfv-xtesting-{tag}-second-run'
662               <<: *xtesting-jobs
663             - name: 'xtesting-opnfv-xtesting-{tag}-third-run'
664               <<: *xtesting-jobs
665             - name: 'xtesting-opnfv-xtesting-{tag}-fourth-run'
666               <<: *xtesting-jobs
667             - name: 'xtesting-opnfv-xtesting-{tag}-fifth-run'
668               <<: *xtesting-jobs
669             - name: 'xtesting-opnfv-xtesting-{tag}-sixth-run'
670               <<: *xtesting-jobs
671             - name: 'xtesting-opnfv-xtesting-{tag}-eighth-run'
672               <<: *xtesting-jobs
673       - multijob:
674           name: opnfv/xtesting-mts:{tag}
675           projects:
676             - name: 'xtesting-opnfv-xtesting-mts-{tag}-seventh-run'
677               <<: *xtesting-jobs
678     publishers:
679       - email-ext:
680           failure: false
681           first-failure: true
682           fixed: true
683           recipients: cedric.ollivier@orange.com
684
685 - project:
686     name: 'xtesting-review'
687     <<: *xtesting-params
688     jobs:
689       - 'xtesting-{tag}-review'
690
691 - view:
692     name: xtesting-review
693     view-type: list
694     columns:
695       - status
696       - weather
697       - job
698       - last-success
699       - last-failure
700       - last-duration
701     regex: ^xtesting-[a-z0-9.]+-review$
702
703 - view:
704     name: xtesting-tox
705     view-type: list
706     columns:
707       - status
708       - weather
709       - job
710       - last-success
711       - last-failure
712       - last-duration
713     regex: ^xtesting-[a-z0-9.]+-tox$
714
715 - builder:
716     name: xtesting-push-containers
717     builders:
718       - shell: |
719           set +x
720           if [ "{repo}" = "_" ]; then
721             image={container}:{tag}
722           elif [ "{port}" = "None" ]; then
723             image={repo}/{container}:{tag}
724           else
725             image={repo}:{port}/{container}:{tag}
726           fi
727           sudo docker push $image
728
729 - trigger:
730     name: xtesting-commit
731     triggers:
732       - pollscm:
733           cron: "*/30 * * * *"
734
735 - job-template:
736     name: 'xtesting-{repo}-{container}-{tag}-build'
737     parameters:
738       - xtesting-slave:
739           slave: '{slave}'
740     scm:
741       - xtesting-scm:
742           ref: '{branch}'
743     builders:
744       - xtesting-build-containers:
745           <<: *xtesting-build-containers
746           ref: '{branch}'
747           build_args: '{build_args}'
748       - xtesting-push-containers:
749           <<: *xtesting-build-containers
750           ref: '{branch}'
751
752 - project:
753     name: xtesting-opnfv-xtesting-{tag}-build
754     <<: *xtesting-params
755     container: xtesting
756     ref_arg: BRANCH
757     path: docker/core
758     jobs:
759       - 'xtesting-{repo}-{container}-{tag}-build'
760
761 - project:
762     name: xtesting-opnfv-xtesting-mts-{tag}-build
763     <<: *xtesting-params
764     container: xtesting-mts
765     ref_arg: BRANCH
766     path: docker/mts
767     jobs:
768       - 'xtesting-{repo}-{container}-{tag}-build'
769
770 - job-template:
771     name: 'xtesting-{tag}-docker'
772     project-type: multijob
773     triggers:
774       - xtesting-commit
775     scm:
776       - xtesting-scm:
777           ref: '{branch}'
778     parameters:
779       - xtesting-slave:
780           slave: '{slave}'
781     # PyYAML and yamllint differ here
782     # see https://github.com/yaml/pyyaml/issues/234
783     # yamllint disable rule:indentation
784     properties:
785       - build-blocker:
786           blocking-jobs:
787           - ^xtesting-(pi-)*{tag}-(daily|docker|review)$
788     # yamllint enable rule:indentation
789     builders:
790       - multijob:
791           name: remove dependency
792           projects:
793             - name: 'xtesting-{repo}-{tag}-dep-rmi'
794               <<: *xtesting-jobs
795       - multijob:
796           name: pull dependency
797           projects:
798             - name: 'xtesting-{repo}-{tag}-dep-pull'
799               <<: *xtesting-jobs
800       - multijob:
801           name: opnfv/xtesting
802           projects:
803             - name: 'xtesting-opnfv-xtesting-{tag}-build'
804               <<: *xtesting-jobs
805       - multijob:
806           name: opnfv/xtesting-mts
807           projects:
808             - name: 'xtesting-opnfv-xtesting-mts-{tag}-build'
809               <<: *xtesting-jobs
810     publishers:
811       - email-ext:
812           failure: false
813           first-failure: true
814           fixed: true
815           recipients: cedric.ollivier@orange.com
816
817 - builder:
818     name: xtesting-trivy
819     builders:
820       - shell: |
821           sudo apt-get -o DPkg::Lock::Timeout=300 update && \
822           sudo DEBIAN_FRONTEND=noninteractive apt-get \
823             -o DPkg::Lock::Timeout=300 install curl -y
824
825           curl -sfL https://raw.githubusercontent.com/aquasecurity/trivy/main/contrib/install.sh | sudo sh -s -- -b .
826           if [ "{repo}" = "_" ]; then
827             image={container}:{tag}
828           elif [ "{port}" = "None" ]; then
829             image={repo}/{container}:{tag}
830           else
831             image={repo}:{port}/{container}:{tag}
832           fi
833           ./trivy --exit-code 1 $image
834
835 - job-template:
836     name: 'xtesting-{repo}-{container}-{tag}-trivy'
837     triggers:
838       - timed: '@daily'
839     parameters:
840       - xtesting-slave:
841           slave: '{slave}'
842     builders:
843       - xtesting-trivy:
844           <<: *xtesting-containers
845     publishers:
846       - email-ext:
847           failure: false
848           first-failure: true
849           fixed: true
850           recipients: cedric.ollivier@orange.com
851
852 - project:
853     name: 'xtesting-opnfv-xtesting-trivy'
854     <<: *xtesting-params
855     container: 'xtesting'
856     jobs:
857       - 'xtesting-{repo}-{container}-{tag}-trivy'
858
859 - project:
860     name: 'xtesting-opnfv-xtesting-mts-trivy'
861     <<: *xtesting-params
862     container: 'xtesting-mts'
863     jobs:
864       - 'xtesting-{repo}-{container}-{tag}-trivy'
865
866 - builder:
867     name: xtesting-grype
868     builders:
869       - shell: |
870           sudo apt-get -o DPkg::Lock::Timeout=300 update && \
871           sudo DEBIAN_FRONTEND=noninteractive apt-get \
872             -o DPkg::Lock::Timeout=300 install curl -y
873
874           curl -sSfL https://raw.githubusercontent.com/anchore/grype/main/install.sh | sudo sh -s -- -b .
875           if [ "{repo}" = "_" ]; then
876             image={container}:{tag}
877           elif [ "{port}" = "None" ]; then
878             image={repo}/{container}:{tag}
879           else
880             image={repo}:{port}/{container}:{tag}
881           fi
882           ./grype -q $image
883
884 - job-template:
885     name: 'xtesting-{repo}-{container}-{tag}-grype'
886     triggers:
887       - timed: '@daily'
888     parameters:
889       - xtesting-slave:
890           slave: '{slave}'
891     builders:
892       - xtesting-grype:
893           <<: *xtesting-containers
894     publishers:
895       - email-ext:
896           failure: false
897           first-failure: true
898           fixed: true
899           recipients: cedric.ollivier@orange.com
900
901 - project:
902     name: 'xtesting-opnfv-xtesting-grype'
903     <<: *xtesting-params
904     container: 'xtesting'
905     jobs:
906       - 'xtesting-{repo}-{container}-{tag}-grype'
907
908 - project:
909     name: 'xtesting-opnfv-xtesting-mts-grype'
910     <<: *xtesting-params
911     container: 'xtesting-mts'
912     jobs:
913       - 'xtesting-{repo}-{container}-{tag}-grype'
914
915 - project:
916     name: 'xtesting'
917     <<: *xtesting-params
918     jobs:
919       - 'xtesting-{tag}-docker'
920
921 - view:
922     name: xtesting-docker
923     view-type: list
924     columns:
925       - status
926       - weather
927       - job
928       - last-success
929       - last-failure
930       - last-duration
931     regex: ^xtesting-[a-z0-9.]+-docker$
932
933 - view:
934     name: xtesting-trivy
935     view-type: list
936     columns:
937       - status
938       - weather
939       - job
940       - last-success
941       - last-failure
942       - last-duration
943     regex: (?!xtesting-pi)^xtesting-[a-z-0-9.]+-trivy$
944
945 - view:
946     name: xtesting-grype
947     view-type: list
948     columns:
949       - status
950       - weather
951       - job
952       - last-success
953       - last-failure
954       - last-duration
955     regex: (?!xtesting-pi)^xtesting-[a-z-0-9.]+-grype$