2 - xtesting-containers: &xtesting-containers
3 name: 'xtesting-containers'
6 container: '{container}'
9 - xtesting-params: &xtesting-params
10 name: 'xtesting-params'
35 branch: stable/wallaby
57 - xtesting-jobs: &xtesting-jobs
59 current-parameters: true
69 name: xtesting-build_tag
74 - xtesting-run-containers: &xtesting-run-containers
75 name: 'xtesting-run-containers'
76 <<: *xtesting-containers
78 privileged: '{privileged}'
84 published_ports: '{published_ports}'
87 name: xtesting-pull-containers
91 if [ "{repo}" = "_" ]; then
92 image={container}:{tag}
93 elif [ "{port}" = "None" ]; then
94 image={repo}/{container}:{tag}
96 image={repo}:{port}/{container}:{tag}
98 sudo docker pull $image
101 name: xtesting-run-containers
106 if [ "{volumes}" != "None" ]; then
107 for i in $(echo {volumes} | tr -d '[]' |sed "s/, / /g" ); \
108 do volumes="-v $i $volumes"; done
111 if [ "{env}" != "None" ]; then
112 for i in $(eval echo {env} | tr -d '[]' |sed "s/, / /g" ); \
113 do env="-e $i $env"; done
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
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}
126 image={repo}:{port}/{container}:{tag}
128 sudo mkdir -p $WORKSPACE/results
129 sudo chown {uid}:{gid} $WORKSPACE/results
130 sudo docker run --rm \
131 --privileged={privileged} \
132 --network={network} \
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
148 name: xtesting-remove-images
152 if [ "{repo}" = "_" ]; then
153 image={container}:{tag}
154 elif [ "{port}" = "None" ]; then
155 image={repo}/{container}:{tag}
157 image={repo}:{port}/{container}:{tag}
159 sudo docker rmi $image || true
162 name: 'xtesting-{repo}-{container}-{tag}-pull'
167 - xtesting-pull-containers:
168 <<: *xtesting-containers
171 name: 'xtesting-opnfv-xtesting-pull'
173 container: 'xtesting'
175 - 'xtesting-{repo}-{container}-{tag}-pull'
178 name: 'xtesting-opnfv-xtesting-mts-pull'
180 container: 'xtesting-mts'
182 - 'xtesting-{repo}-{container}-{tag}-pull'
185 name: 'xtesting-{repo}-{container}-{tag}-rmi'
190 - xtesting-remove-images:
191 <<: *xtesting-containers
194 name: 'xtesting-opnfv-xtesting-rmi'
196 container: 'xtesting'
198 - 'xtesting-{repo}-{container}-{tag}-rmi'
201 name: 'xtesting-opnfv-xtesting-mts-rmi'
203 container: 'xtesting-mts'
205 - 'xtesting-{repo}-{container}-{tag}-rmi'
208 name: 'xtesting-opnfv-xtesting-{tag}-{test}-run'
212 - xtesting-build_tag:
215 - xtesting-run-containers:
216 <<: *xtesting-run-containers
219 name: 'xtesting-opnfv-xtesting'
224 container: 'xtesting'
245 - 'xtesting-opnfv-xtesting-{tag}-{test}-run'
248 name: 'xtesting-opnfv-xtesting-mts-{tag}-{test}-run'
252 - xtesting-build_tag:
255 - xtesting-run-containers:
256 <<: *xtesting-run-containers
259 name: 'xtesting-opnfv-xtesting-mts'
264 container: 'xtesting-mts'
272 - 'xtesting-opnfv-xtesting-mts-{tag}-{test}-run'
280 if [ "{volumes}" != "None" ]; then
281 for i in $(echo {volumes} | tr -d '[]' |sed "s/, / /g" ); \
282 do volumes="-v $i $volumes"; done
285 if [ "{env}" != "None" ]; then
286 for i in $(eval echo {env} | tr -d '[]' |sed "s/, / /g" ); \
287 do env="-e $i $env"; done
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
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}
300 image={repo}:{port}/{container}:{tag}
302 sudo mkdir -p $WORKSPACE/results
303 sudo chown {uid}:{gid} $WORKSPACE/results
304 sudo docker run --rm \
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 \
319 name: 'xtesting-{tag}-zip'
323 - xtesting-build_tag:
327 <<: *xtesting-containers
332 published_ports: '{published_ports}'
335 name: 'xtesting-{tag}-zip'
340 container: 'xtesting'
344 - 'xtesting-{tag}-zip'
347 name: 'xtesting-{tag}-daily'
348 project-type: multijob
354 - xtesting-build_tag:
356 # PyYAML and yamllint differ here
357 # see https://github.com/yaml/pyyaml/issues/234
358 # yamllint disable rule:indentation
362 - ^xtesting-(pi-)*{tag}-(daily|docker|review)$
363 # yamllint enable rule:indentation
366 name: remove former images
368 - name: 'xtesting-opnfv-xtesting-{tag}-rmi'
370 - name: 'xtesting-opnfv-xtesting-mts-{tag}-rmi'
373 name: pull containers
375 - name: 'xtesting-opnfv-xtesting-{tag}-pull'
377 - name: 'xtesting-opnfv-xtesting-mts-{tag}-pull'
380 name: opnfv/xtesting:{tag}
382 - name: 'xtesting-opnfv-xtesting-{tag}-first-run'
384 - name: 'xtesting-opnfv-xtesting-{tag}-second-run'
386 - name: 'xtesting-opnfv-xtesting-{tag}-third-run'
388 - name: 'xtesting-opnfv-xtesting-{tag}-fourth-run'
390 - name: 'xtesting-opnfv-xtesting-{tag}-fifth-run'
392 - name: 'xtesting-opnfv-xtesting-{tag}-sixth-run'
394 - name: 'xtesting-opnfv-xtesting-{tag}-eighth-run'
397 name: opnfv/xtesting-mts:{tag}
399 - name: 'xtesting-opnfv-xtesting-mts-{tag}-seventh-run'
402 name: dump all campaign data
404 - name: 'xtesting-{tag}-zip'
411 recipients: cedric.ollivier@orange.com
414 name: 'xtesting-daily'
417 - 'xtesting-{tag}-daily'
429 regex: ^xtesting-[a-z0-9.]+-daily$
431 - xtesting-build-containers: &xtesting-build-containers
432 name: 'xtesting-build-containers'
433 <<: *xtesting-containers
436 build_args: '{build_args}'
440 name: xtesting-build-containers
444 if [ "{repo}" = "_" ]; then
445 image={container}:{tag}
446 elif [ "{port}" = "None" ]; then
447 image={repo}/{container}:{tag}
449 image={repo}:{port}/{container}:{tag}
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
456 if [ "{ref_arg}" != "None" ]; then
457 build_args="$build_args --build-arg {ref_arg}={ref}"
460 if [ "{from}" != "None" ]; then
461 sed -i {from} Dockerfile
463 sudo docker build $build_args \
464 --pull=false --no-cache --force-rm=true \
471 url: 'https://gerrit.opnfv.org/gerrit/functest-xtesting'
472 refspec: '+refs/heads/*:refs/remotes/origin/* +refs/changes/*:refs/changes/*'
476 - xtesting-dep: &xtesting-dep
477 name: 'xtesting-containers'
481 dependency: '{dependency}'
484 name: xtesting-pull-dep-images
488 if [ "_" = "_" ]; then
489 image=alpine:{dependency}
490 elif [ "" = "None" ]; then
491 image=_/alpine:{dependency}
493 image=_:/alpine:{dependency}
495 sudo docker pull $image || true
498 name: xtesting-remove-dep-images
502 if [ "_" = "_" ]; then
503 image=alpine:{dependency}
504 elif [ "" = "None" ]; then
505 image=_/alpine:{dependency}
507 image=_:/alpine:{dependency}
509 sudo docker rmi $image || true
512 name: 'xtesting-{repo}-{tag}-dep-pull'
517 - xtesting-pull-dep-images:
521 name: 'xtesting-{repo}-{tag}-dep-pull'
524 - 'xtesting-{repo}-{tag}-dep-pull'
527 name: 'xtesting-{repo}-{tag}-dep-rmi'
532 - xtesting-remove-dep-images:
536 name: 'xtesting-{repo}-{tag}-dep-rmi'
539 - 'xtesting-{repo}-{tag}-dep-rmi'
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.10 python3.10-dev python3.10-distutils \
556 python3.9 python3.9-dev python3.9-distutils \
557 python3.8 python3.8-dev python3.8-distutils \
558 python3.7 python3.7-dev python3.6 python3.6-dev \
559 python python-dev python3-pip enchant -y
560 sudo pip3 install tox tox-pip-version
565 name: 'xtesting-{tag}-tox'
570 - xtesting-patchset-created:
582 - 'xtesting-{tag}-tox'
585 name: 'xtesting-{repo}-{container}-{tag}-gate'
593 - xtesting-build-containers:
594 <<: *xtesting-build-containers
596 build_args: '{build_args}'
599 name: xtesting-opnfv-xtesting-{tag}-gate
605 - 'xtesting-{repo}-{container}-{tag}-gate'
608 name: xtesting-opnfv-xtesting-mts-{tag}-gate
610 container: xtesting-mts
614 - 'xtesting-{repo}-{container}-{tag}-gate'
617 name: xtesting-patchset-created
621 - patchset-created-event
622 - comment-added-contains-event:
623 comment-contains-value: 'recheck'
624 - comment-added-contains-event:
625 comment-contains-value: 'reverify'
627 - project-compare-type: 'ANT'
628 project-pattern: 'functest-xtesting'
630 - branch-compare-type: 'ANT'
631 branch-pattern: '**/{branch}'
634 name: 'xtesting-{tag}-review'
635 project-type: multijob
637 - xtesting-patchset-created:
642 - xtesting-build_tag:
644 # PyYAML and yamllint differ here
645 # see https://github.com/yaml/pyyaml/issues/234
646 # yamllint disable rule:indentation
650 - ^xtesting-(pi-)*{tag}-(daily|docker|review)$
651 # yamllint enable rule:indentation
654 name: remove former images
656 - name: 'xtesting-opnfv-xtesting-{tag}-rmi'
658 - name: 'xtesting-opnfv-xtesting-mts-{tag}-rmi'
661 name: remove dependency
663 - name: 'xtesting-{repo}-{tag}-dep-rmi'
666 name: pull dependency
668 - name: 'xtesting-{repo}-{tag}-dep-pull'
673 - name: 'xtesting-opnfv-xtesting-{tag}-gate'
676 name: opnfv/xtesting-mts
678 - name: 'xtesting-opnfv-xtesting-mts-{tag}-gate'
681 name: opnfv/xtesting:{tag}
683 - name: 'xtesting-opnfv-xtesting-{tag}-first-run'
685 - name: 'xtesting-opnfv-xtesting-{tag}-second-run'
687 - name: 'xtesting-opnfv-xtesting-{tag}-third-run'
689 - name: 'xtesting-opnfv-xtesting-{tag}-fourth-run'
691 - name: 'xtesting-opnfv-xtesting-{tag}-fifth-run'
693 - name: 'xtesting-opnfv-xtesting-{tag}-sixth-run'
695 - name: 'xtesting-opnfv-xtesting-{tag}-eighth-run'
698 name: opnfv/xtesting-mts:{tag}
700 - name: 'xtesting-opnfv-xtesting-mts-{tag}-seventh-run'
707 recipients: cedric.ollivier@orange.com
710 name: 'xtesting-review'
713 - 'xtesting-{tag}-review'
716 name: xtesting-review
725 regex: ^xtesting-[a-z0-9.]+-review$
737 regex: ^xtesting-[a-z0-9.]+-tox$
740 name: xtesting-push-containers
744 if [ "{repo}" = "_" ]; then
745 image={container}:{tag}
746 elif [ "{port}" = "None" ]; then
747 image={repo}/{container}:{tag}
749 image={repo}:{port}/{container}:{tag}
751 sudo docker push $image
754 name: xtesting-commit
760 name: 'xtesting-{repo}-{container}-{tag}-build'
768 - xtesting-build-containers:
769 <<: *xtesting-build-containers
771 build_args: '{build_args}'
772 - xtesting-push-containers:
773 <<: *xtesting-build-containers
777 name: xtesting-opnfv-xtesting-{tag}-build
783 - 'xtesting-{repo}-{container}-{tag}-build'
786 name: xtesting-opnfv-xtesting-mts-{tag}-build
788 container: xtesting-mts
792 - 'xtesting-{repo}-{container}-{tag}-build'
795 name: 'xtesting-{tag}-docker'
796 project-type: multijob
805 # PyYAML and yamllint differ here
806 # see https://github.com/yaml/pyyaml/issues/234
807 # yamllint disable rule:indentation
811 - ^xtesting-(pi-)*{tag}-(daily|docker|review)$
812 # yamllint enable rule:indentation
815 name: remove dependency
817 - name: 'xtesting-{repo}-{tag}-dep-rmi'
820 name: pull dependency
822 - name: 'xtesting-{repo}-{tag}-dep-pull'
827 - name: 'xtesting-opnfv-xtesting-{tag}-build'
830 name: opnfv/xtesting-mts
832 - name: 'xtesting-opnfv-xtesting-mts-{tag}-build'
839 recipients: cedric.ollivier@orange.com
845 sudo apt-get -o DPkg::Lock::Timeout=300 update && \
846 sudo DEBIAN_FRONTEND=noninteractive apt-get \
847 -o DPkg::Lock::Timeout=300 install curl -y
849 curl -sfL https://raw.githubusercontent.com/aquasecurity/trivy/main/contrib/install.sh | sudo sh -s -- -b .
850 if [ "{repo}" = "_" ]; then
851 image={container}:{tag}
852 elif [ "{port}" = "None" ]; then
853 image={repo}/{container}:{tag}
855 image={repo}:{port}/{container}:{tag}
857 ./trivy image --exit-code 1 $image
860 name: 'xtesting-{repo}-{container}-{tag}-trivy'
868 <<: *xtesting-containers
874 recipients: cedric.ollivier@orange.com
877 name: 'xtesting-opnfv-xtesting-trivy'
879 container: 'xtesting'
881 - 'xtesting-{repo}-{container}-{tag}-trivy'
884 name: 'xtesting-opnfv-xtesting-mts-trivy'
886 container: 'xtesting-mts'
888 - 'xtesting-{repo}-{container}-{tag}-trivy'
894 sudo apt-get -o DPkg::Lock::Timeout=300 update && \
895 sudo DEBIAN_FRONTEND=noninteractive apt-get \
896 -o DPkg::Lock::Timeout=300 install curl -y
898 curl -sSfL https://raw.githubusercontent.com/anchore/grype/main/install.sh | sudo sh -s -- -b .
899 if [ "{repo}" = "_" ]; then
900 image={container}:{tag}
901 elif [ "{port}" = "None" ]; then
902 image={repo}/{container}:{tag}
904 image={repo}:{port}/{container}:{tag}
909 name: 'xtesting-{repo}-{container}-{tag}-grype'
917 <<: *xtesting-containers
923 recipients: cedric.ollivier@orange.com
926 name: 'xtesting-opnfv-xtesting-grype'
928 container: 'xtesting'
930 - 'xtesting-{repo}-{container}-{tag}-grype'
933 name: 'xtesting-opnfv-xtesting-mts-grype'
935 container: 'xtesting-mts'
937 - 'xtesting-{repo}-{container}-{tag}-grype'
943 - 'xtesting-{tag}-docker'
946 name: xtesting-docker
955 regex: ^xtesting-[a-z0-9.]+-docker$
967 regex: (?!xtesting-pi)^xtesting-[a-z-0-9.]+-trivy$
979 regex: (?!xtesting-pi)^xtesting-[a-z-0-9.]+-grype$