2 - xtesting-containers: &xtesting-containers
3 name: 'xtesting-containers'
6 container: '{container}'
9 - xtesting-params: &xtesting-params
10 name: 'xtesting-params'
41 branch: stable/wallaby
45 - xtesting-jobs: &xtesting-jobs
47 current-parameters: true
57 name: xtesting-build_tag
62 - xtesting-run-containers: &xtesting-run-containers
63 name: 'xtesting-run-containers'
64 <<: *xtesting-containers
66 privileged: '{privileged}'
72 published_ports: '{published_ports}'
75 name: xtesting-pull-containers
79 if [ "{repo}" = "_" ]; then
80 image={container}:{tag}
81 elif [ "{port}" = "None" ]; then
82 image={repo}/{container}:{tag}
84 image={repo}:{port}/{container}:{tag}
86 sudo docker pull $image
89 name: xtesting-run-containers
94 if [ "{volumes}" != "None" ]; then
95 for i in $(echo {volumes} | tr -d '[]' |sed "s/, / /g" ); \
96 do volumes="-v $i $volumes"; done
99 if [ "{env}" != "None" ]; then
100 for i in $(eval echo {env} | tr -d '[]' |sed "s/, / /g" ); \
101 do env="-e $i $env"; done
104 if [ "{published_ports}" != "None" ]; then
105 for i in $(echo {published_ports} | tr -d '[]' |sed "s/, / /g" ); \
106 do published_ports="-p $i $published_ports"; done
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}
114 image={repo}:{port}/{container}:{tag}
116 sudo mkdir -p $WORKSPACE/results
117 sudo chown {uid}:{gid} $WORKSPACE/results
118 sudo docker run --rm \
119 --privileged={privileged} \
120 --network={network} \
124 -e S3_ENDPOINT_URL=https://storage.googleapis.com \
125 -e S3_DST_URL=s3://artifacts.opnfv.org/xtesting/$BUILD_TAG/$JOB_NAME-$BUILD_ID \
126 -e HTTP_DST_URL=http://artifacts.opnfv.org/xtesting/$BUILD_TAG/$JOB_NAME-$BUILD_ID \
127 -v /home/opnfv/xtesting/.boto:/etc/boto.cfg \
128 -e TEST_DB_URL=http://testresults.opnfv.org/test/api/v1/results \
129 -e TEST_DB_EXT_URL=http://testresults.opnfv.org/test/api/v1/results \
131 -e BUILD_TAG=$BUILD_TAG \
132 -v $WORKSPACE/../$JOB_NAME/results:/var/lib/xtesting/results \
133 $image run_tests -t {test} -p -r
136 name: xtesting-remove-images
140 if [ "{repo}" = "_" ]; then
141 image={container}:{tag}
142 elif [ "{port}" = "None" ]; then
143 image={repo}/{container}:{tag}
145 image={repo}:{port}/{container}:{tag}
147 sudo docker rmi $image || true
150 name: 'xtesting-{repo}-{container}-{tag}-pull'
155 - xtesting-pull-containers:
156 <<: *xtesting-containers
159 name: 'xtesting-opnfv-xtesting-pull'
161 container: 'xtesting'
163 - 'xtesting-{repo}-{container}-{tag}-pull'
166 name: 'xtesting-opnfv-xtesting-mts-pull'
168 container: 'xtesting-mts'
170 - 'xtesting-{repo}-{container}-{tag}-pull'
173 name: 'xtesting-{repo}-{container}-{tag}-rmi'
178 - xtesting-remove-images:
179 <<: *xtesting-containers
182 name: 'xtesting-opnfv-xtesting-rmi'
184 container: 'xtesting'
186 - 'xtesting-{repo}-{container}-{tag}-rmi'
189 name: 'xtesting-opnfv-xtesting-mts-rmi'
191 container: 'xtesting-mts'
193 - 'xtesting-{repo}-{container}-{tag}-rmi'
196 name: 'xtesting-opnfv-xtesting-{tag}-{test}-run'
200 - xtesting-build_tag:
203 - xtesting-run-containers:
204 <<: *xtesting-run-containers
207 name: 'xtesting-opnfv-xtesting'
212 container: 'xtesting'
226 - 'xtesting-opnfv-xtesting-{tag}-{test}-run'
229 name: 'xtesting-opnfv-xtesting-mts-{tag}-{test}-run'
233 - xtesting-build_tag:
236 - xtesting-run-containers:
237 <<: *xtesting-run-containers
240 name: 'xtesting-opnfv-xtesting-mts'
245 container: 'xtesting-mts'
253 - 'xtesting-opnfv-xtesting-mts-{tag}-{test}-run'
261 if [ "{volumes}" != "None" ]; then
262 for i in $(echo {volumes} | tr -d '[]' |sed "s/, / /g" ); \
263 do volumes="-v $i $volumes"; done
266 if [ "{env}" != "None" ]; then
267 for i in $(eval echo {env} | tr -d '[]' |sed "s/, / /g" ); \
268 do env="-e $i $env"; done
271 if [ "{published_ports}" != "None" ]; then
272 for i in $(echo {published_ports} | tr -d '[]' |sed "s/, / /g" ); \
273 do published_ports="-p $i $published_ports"; done
275 [ ! -z "$WORKSPACE" ] && sudo rm -rf $WORKSPACE/results || true
276 if [ "{repo}" = "_" ]; then
277 image={container}:{tag}
278 elif [ "{port}" = "None" ]; then
279 image={repo}/{container}:{tag}
281 image={repo}:{port}/{container}:{tag}
283 sudo mkdir -p $WORKSPACE/results
284 sudo chown {uid}:{gid} $WORKSPACE/results
285 sudo docker run --rm \
289 -e S3_ENDPOINT_URL=https://storage.googleapis.com \
290 -e S3_DST_URL=s3://artifacts.opnfv.org/xtesting \
291 -e HTTP_DST_URL=http://artifacts.opnfv.org/xtesting \
292 -v /home/opnfv/xtesting/.boto:/etc/boto.cfg \
293 -e TEST_DB_URL=http://testresults.opnfv.org/test/api/v1/results \
294 -e TEST_DB_EXT_URL=http://testresults.opnfv.org/test/api/v1/results \
295 -e BUILD_TAG=$BUILD_TAG \
296 -v $WORKSPACE/../$JOB_NAME/results:/var/lib/xtesting/results \
300 name: 'xtesting-{tag}-zip'
304 - xtesting-build_tag:
308 <<: *xtesting-containers
313 published_ports: '{published_ports}'
316 name: 'xtesting-{tag}-zip'
321 container: 'xtesting'
325 - 'xtesting-{tag}-zip'
328 name: 'xtesting-{tag}-daily'
329 project-type: multijob
335 - xtesting-build_tag:
337 # PyYAML and yamllint differ here
338 # see https://github.com/yaml/pyyaml/issues/234
339 # yamllint disable rule:indentation
343 - ^xtesting-(pi-)*{tag}-(daily|docker|review)$
344 # yamllint enable rule:indentation
347 name: remove former images
349 - name: 'xtesting-opnfv-xtesting-{tag}-rmi'
351 - name: 'xtesting-opnfv-xtesting-mts-{tag}-rmi'
354 name: pull containers
356 - name: 'xtesting-opnfv-xtesting-{tag}-pull'
358 - name: 'xtesting-opnfv-xtesting-mts-{tag}-pull'
361 name: opnfv/xtesting:{tag}
363 - name: 'xtesting-opnfv-xtesting-{tag}-first-run'
365 - name: 'xtesting-opnfv-xtesting-{tag}-second-run'
367 - name: 'xtesting-opnfv-xtesting-{tag}-third-run'
369 - name: 'xtesting-opnfv-xtesting-{tag}-fourth-run'
371 - name: 'xtesting-opnfv-xtesting-{tag}-fifth-run'
373 - name: 'xtesting-opnfv-xtesting-{tag}-sixth-run'
375 - name: 'xtesting-opnfv-xtesting-{tag}-eighth-run'
378 name: opnfv/xtesting-mts:{tag}
380 - name: 'xtesting-opnfv-xtesting-mts-{tag}-seventh-run'
383 name: dump all campaign data
385 - name: 'xtesting-{tag}-zip'
392 recipients: cedric.ollivier@orange.com
395 name: 'xtesting-daily'
398 - 'xtesting-{tag}-daily'
410 regex: ^xtesting-[a-z0-9.]+-daily$
412 - xtesting-build-containers: &xtesting-build-containers
413 name: 'xtesting-build-containers'
414 <<: *xtesting-containers
417 build_args: '{build_args}'
421 name: xtesting-build-containers
425 if [ "{repo}" = "_" ]; then
426 image={container}:{tag}
427 elif [ "{port}" = "None" ]; then
428 image={repo}/{container}:{tag}
430 image={repo}:{port}/{container}:{tag}
433 if [ "{build_args}" != "None" ]; then
434 for i in $(echo {build_args} | tr -d '[]' |sed "s/, / /g" ); \
435 do build_args="--build-arg $i $build_args"; done
437 if [ "{ref_arg}" != "None" ]; then
438 build_args="$build_args --build-arg {ref_arg}={ref}"
441 if [ "{from}" != "None" ]; then
442 sed -i {from} Dockerfile
444 sudo docker build $build_args \
445 --pull=false --no-cache --force-rm=true \
452 url: 'https://gerrit.opnfv.org/gerrit/functest-xtesting'
453 refspec: '+refs/heads/*:refs/remotes/origin/* +refs/changes/*:refs/changes/*'
457 - xtesting-dep: &xtesting-dep
458 name: 'xtesting-containers'
462 dependency: '{dependency}'
465 name: xtesting-pull-dep-images
469 if [ "_" = "_" ]; then
470 image=alpine:{dependency}
471 elif [ "" = "None" ]; then
472 image=_/alpine:{dependency}
474 image=_:/alpine:{dependency}
476 sudo docker pull $image || true
479 name: xtesting-remove-dep-images
483 if [ "_" = "_" ]; then
484 image=alpine:{dependency}
485 elif [ "" = "None" ]; then
486 image=_/alpine:{dependency}
488 image=_:/alpine:{dependency}
490 sudo docker rmi $image || true
493 name: 'xtesting-{repo}-{tag}-dep-pull'
498 - xtesting-pull-dep-images:
502 name: 'xtesting-{repo}-{tag}-dep-pull'
505 - 'xtesting-{repo}-{tag}-dep-pull'
508 name: 'xtesting-{repo}-{tag}-dep-rmi'
513 - xtesting-remove-dep-images:
517 name: 'xtesting-{repo}-{tag}-dep-rmi'
520 - 'xtesting-{repo}-{tag}-dep-rmi'
527 sudo apt-get -o DPkg::Lock::Timeout=300 update && \
528 sudo DEBIAN_FRONTEND=noninteractive apt-get \
529 -o DPkg::Lock::Timeout=300 dist-upgrade -y
530 sudo DEBIAN_FRONTEND=noninteractive \
531 apt-get -o DPkg::Lock::Timeout=300 install software-properties-common gpg -y
532 sudo add-apt-repository -y ppa:deadsnakes/ppa
533 sudo apt-get -o DPkg::Lock::Timeout=300 update && \
534 sudo DEBIAN_FRONTEND=noninteractive apt-get \
535 -o DPkg::Lock::Timeout=300 install \
536 libxml2-dev libxslt-dev libffi-dev libjpeg-dev \
537 python3.10 python3.10-dev python3.10-distutils \
538 python3.9 python3.9-dev python3.9-distutils \
539 python3.8 python3.8-dev python3.8-distutils \
540 python3-pip enchant-2 -y
541 sudo pip3 install tox tox-pip-version
546 name: 'xtesting-{tag}-tox'
551 - xtesting-patchset-created:
563 - 'xtesting-{tag}-tox'
566 name: 'xtesting-{repo}-{container}-{tag}-gate'
574 - xtesting-build-containers:
575 <<: *xtesting-build-containers
577 build_args: '{build_args}'
580 name: xtesting-opnfv-xtesting-{tag}-gate
586 - 'xtesting-{repo}-{container}-{tag}-gate'
589 name: xtesting-opnfv-xtesting-mts-{tag}-gate
591 container: xtesting-mts
595 - 'xtesting-{repo}-{container}-{tag}-gate'
598 name: xtesting-patchset-created
602 - patchset-created-event
603 - comment-added-contains-event:
604 comment-contains-value: 'recheck'
605 - comment-added-contains-event:
606 comment-contains-value: 'reverify'
608 - project-compare-type: 'ANT'
609 project-pattern: 'functest-xtesting'
611 - branch-compare-type: 'ANT'
612 branch-pattern: '**/{branch}'
615 name: 'xtesting-{tag}-review'
616 project-type: multijob
618 - xtesting-patchset-created:
623 - xtesting-build_tag:
625 # PyYAML and yamllint differ here
626 # see https://github.com/yaml/pyyaml/issues/234
627 # yamllint disable rule:indentation
631 - ^xtesting-(pi-)*{tag}-(daily|docker|review)$
632 # yamllint enable rule:indentation
635 name: remove former images
637 - name: 'xtesting-opnfv-xtesting-{tag}-rmi'
639 - name: 'xtesting-opnfv-xtesting-mts-{tag}-rmi'
642 name: remove dependency
644 - name: 'xtesting-{repo}-{tag}-dep-rmi'
647 name: pull dependency
649 - name: 'xtesting-{repo}-{tag}-dep-pull'
654 - name: 'xtesting-opnfv-xtesting-{tag}-gate'
657 name: opnfv/xtesting-mts
659 - name: 'xtesting-opnfv-xtesting-mts-{tag}-gate'
662 name: opnfv/xtesting:{tag}
664 - name: 'xtesting-opnfv-xtesting-{tag}-first-run'
666 - name: 'xtesting-opnfv-xtesting-{tag}-second-run'
668 - name: 'xtesting-opnfv-xtesting-{tag}-third-run'
670 - name: 'xtesting-opnfv-xtesting-{tag}-fourth-run'
672 - name: 'xtesting-opnfv-xtesting-{tag}-fifth-run'
674 - name: 'xtesting-opnfv-xtesting-{tag}-sixth-run'
676 - name: 'xtesting-opnfv-xtesting-{tag}-eighth-run'
679 name: opnfv/xtesting-mts:{tag}
681 - name: 'xtesting-opnfv-xtesting-mts-{tag}-seventh-run'
688 recipients: cedric.ollivier@orange.com
691 name: 'xtesting-review'
694 - 'xtesting-{tag}-review'
697 name: xtesting-review
706 regex: ^xtesting-[a-z0-9.]+-review$
718 regex: ^xtesting-[a-z0-9.]+-tox$
721 name: xtesting-push-containers
725 if [ "{repo}" = "_" ]; then
726 image={container}:{tag}
727 elif [ "{port}" = "None" ]; then
728 image={repo}/{container}:{tag}
730 image={repo}:{port}/{container}:{tag}
732 sudo docker push $image
735 name: xtesting-commit
741 name: 'xtesting-{repo}-{container}-{tag}-build'
749 - xtesting-build-containers:
750 <<: *xtesting-build-containers
752 build_args: '{build_args}'
753 - xtesting-push-containers:
754 <<: *xtesting-build-containers
758 name: xtesting-opnfv-xtesting-{tag}-build
764 - 'xtesting-{repo}-{container}-{tag}-build'
767 name: xtesting-opnfv-xtesting-mts-{tag}-build
769 container: xtesting-mts
773 - 'xtesting-{repo}-{container}-{tag}-build'
776 name: 'xtesting-{tag}-docker'
777 project-type: multijob
786 # PyYAML and yamllint differ here
787 # see https://github.com/yaml/pyyaml/issues/234
788 # yamllint disable rule:indentation
792 - ^xtesting-(pi-)*{tag}-(daily|docker|review)$
793 # yamllint enable rule:indentation
796 name: remove dependency
798 - name: 'xtesting-{repo}-{tag}-dep-rmi'
801 name: pull dependency
803 - name: 'xtesting-{repo}-{tag}-dep-pull'
808 - name: 'xtesting-opnfv-xtesting-{tag}-build'
811 name: opnfv/xtesting-mts
813 - name: 'xtesting-opnfv-xtesting-mts-{tag}-build'
820 recipients: cedric.ollivier@orange.com
826 sudo apt-get -o DPkg::Lock::Timeout=300 update && \
827 sudo DEBIAN_FRONTEND=noninteractive apt-get \
828 -o DPkg::Lock::Timeout=300 install curl -y
830 curl -sfL https://raw.githubusercontent.com/aquasecurity/trivy/main/contrib/install.sh | sudo sh -s -- -b .
831 if [ "{repo}" = "_" ]; then
832 image={container}:{tag}
833 elif [ "{port}" = "None" ]; then
834 image={repo}/{container}:{tag}
836 image={repo}:{port}/{container}:{tag}
838 ./trivy image --exit-code 1 $image
841 name: 'xtesting-{repo}-{container}-{tag}-trivy'
849 <<: *xtesting-containers
855 recipients: cedric.ollivier@orange.com
858 name: 'xtesting-opnfv-xtesting-trivy'
860 container: 'xtesting'
862 - 'xtesting-{repo}-{container}-{tag}-trivy'
865 name: 'xtesting-opnfv-xtesting-mts-trivy'
867 container: 'xtesting-mts'
869 - 'xtesting-{repo}-{container}-{tag}-trivy'
875 sudo apt-get -o DPkg::Lock::Timeout=300 update && \
876 sudo DEBIAN_FRONTEND=noninteractive apt-get \
877 -o DPkg::Lock::Timeout=300 install curl -y
879 curl -sSfL https://raw.githubusercontent.com/anchore/grype/main/install.sh | sudo sh -s -- -b .
880 if [ "{repo}" = "_" ]; then
881 image={container}:{tag}
882 elif [ "{port}" = "None" ]; then
883 image={repo}/{container}:{tag}
885 image={repo}:{port}/{container}:{tag}
890 name: 'xtesting-{repo}-{container}-{tag}-grype'
898 <<: *xtesting-containers
904 recipients: cedric.ollivier@orange.com
907 name: 'xtesting-opnfv-xtesting-grype'
909 container: 'xtesting'
911 - 'xtesting-{repo}-{container}-{tag}-grype'
914 name: 'xtesting-opnfv-xtesting-mts-grype'
916 container: 'xtesting-mts'
918 - 'xtesting-{repo}-{container}-{tag}-grype'
924 - 'xtesting-{tag}-docker'
927 name: xtesting-docker
936 regex: ^xtesting-[a-z0-9.]+-docker$
948 regex: (?!xtesting-pi)^xtesting-[a-z-0-9.]+-trivy$
960 regex: (?!xtesting-pi)^xtesting-[a-z-0-9.]+-grype$