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