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 libxml2-dev libxslt-dev libffi-dev libjpeg-dev \
556 python3.10 python3.10-dev python3.10-distutils \
557 python3.9 python3.9-dev python3.9-distutils \
558 python3.8 python3.8-dev python3.8-distutils \
559 python3.7 python3.7-dev python3.6 python3.6-dev \
560 python python-dev python3-pip enchant -y
561 sudo pip3 install tox tox-pip-version
566 name: 'xtesting-{tag}-tox'
571 - xtesting-patchset-created:
583 - 'xtesting-{tag}-tox'
586 name: 'xtesting-{repo}-{container}-{tag}-gate'
594 - xtesting-build-containers:
595 <<: *xtesting-build-containers
597 build_args: '{build_args}'
600 name: xtesting-opnfv-xtesting-{tag}-gate
606 - 'xtesting-{repo}-{container}-{tag}-gate'
609 name: xtesting-opnfv-xtesting-mts-{tag}-gate
611 container: xtesting-mts
615 - 'xtesting-{repo}-{container}-{tag}-gate'
618 name: xtesting-patchset-created
622 - patchset-created-event
623 - comment-added-contains-event:
624 comment-contains-value: 'recheck'
625 - comment-added-contains-event:
626 comment-contains-value: 'reverify'
628 - project-compare-type: 'ANT'
629 project-pattern: 'functest-xtesting'
631 - branch-compare-type: 'ANT'
632 branch-pattern: '**/{branch}'
635 name: 'xtesting-{tag}-review'
636 project-type: multijob
638 - xtesting-patchset-created:
643 - xtesting-build_tag:
645 # PyYAML and yamllint differ here
646 # see https://github.com/yaml/pyyaml/issues/234
647 # yamllint disable rule:indentation
651 - ^xtesting-(pi-)*{tag}-(daily|docker|review)$
652 # yamllint enable rule:indentation
655 name: remove former images
657 - name: 'xtesting-opnfv-xtesting-{tag}-rmi'
659 - name: 'xtesting-opnfv-xtesting-mts-{tag}-rmi'
662 name: remove dependency
664 - name: 'xtesting-{repo}-{tag}-dep-rmi'
667 name: pull dependency
669 - name: 'xtesting-{repo}-{tag}-dep-pull'
674 - name: 'xtesting-opnfv-xtesting-{tag}-gate'
677 name: opnfv/xtesting-mts
679 - name: 'xtesting-opnfv-xtesting-mts-{tag}-gate'
682 name: opnfv/xtesting:{tag}
684 - name: 'xtesting-opnfv-xtesting-{tag}-first-run'
686 - name: 'xtesting-opnfv-xtesting-{tag}-second-run'
688 - name: 'xtesting-opnfv-xtesting-{tag}-third-run'
690 - name: 'xtesting-opnfv-xtesting-{tag}-fourth-run'
692 - name: 'xtesting-opnfv-xtesting-{tag}-fifth-run'
694 - name: 'xtesting-opnfv-xtesting-{tag}-sixth-run'
696 - name: 'xtesting-opnfv-xtesting-{tag}-eighth-run'
699 name: opnfv/xtesting-mts:{tag}
701 - name: 'xtesting-opnfv-xtesting-mts-{tag}-seventh-run'
708 recipients: cedric.ollivier@orange.com
711 name: 'xtesting-review'
714 - 'xtesting-{tag}-review'
717 name: xtesting-review
726 regex: ^xtesting-[a-z0-9.]+-review$
738 regex: ^xtesting-[a-z0-9.]+-tox$
741 name: xtesting-push-containers
745 if [ "{repo}" = "_" ]; then
746 image={container}:{tag}
747 elif [ "{port}" = "None" ]; then
748 image={repo}/{container}:{tag}
750 image={repo}:{port}/{container}:{tag}
752 sudo docker push $image
755 name: xtesting-commit
761 name: 'xtesting-{repo}-{container}-{tag}-build'
769 - xtesting-build-containers:
770 <<: *xtesting-build-containers
772 build_args: '{build_args}'
773 - xtesting-push-containers:
774 <<: *xtesting-build-containers
778 name: xtesting-opnfv-xtesting-{tag}-build
784 - 'xtesting-{repo}-{container}-{tag}-build'
787 name: xtesting-opnfv-xtesting-mts-{tag}-build
789 container: xtesting-mts
793 - 'xtesting-{repo}-{container}-{tag}-build'
796 name: 'xtesting-{tag}-docker'
797 project-type: multijob
806 # PyYAML and yamllint differ here
807 # see https://github.com/yaml/pyyaml/issues/234
808 # yamllint disable rule:indentation
812 - ^xtesting-(pi-)*{tag}-(daily|docker|review)$
813 # yamllint enable rule:indentation
816 name: remove dependency
818 - name: 'xtesting-{repo}-{tag}-dep-rmi'
821 name: pull dependency
823 - name: 'xtesting-{repo}-{tag}-dep-pull'
828 - name: 'xtesting-opnfv-xtesting-{tag}-build'
831 name: opnfv/xtesting-mts
833 - name: 'xtesting-opnfv-xtesting-mts-{tag}-build'
840 recipients: cedric.ollivier@orange.com
846 sudo apt-get -o DPkg::Lock::Timeout=300 update && \
847 sudo DEBIAN_FRONTEND=noninteractive apt-get \
848 -o DPkg::Lock::Timeout=300 install curl -y
850 curl -sfL https://raw.githubusercontent.com/aquasecurity/trivy/main/contrib/install.sh | sudo sh -s -- -b .
851 if [ "{repo}" = "_" ]; then
852 image={container}:{tag}
853 elif [ "{port}" = "None" ]; then
854 image={repo}/{container}:{tag}
856 image={repo}:{port}/{container}:{tag}
858 ./trivy image --exit-code 1 $image
861 name: 'xtesting-{repo}-{container}-{tag}-trivy'
869 <<: *xtesting-containers
875 recipients: cedric.ollivier@orange.com
878 name: 'xtesting-opnfv-xtesting-trivy'
880 container: 'xtesting'
882 - 'xtesting-{repo}-{container}-{tag}-trivy'
885 name: 'xtesting-opnfv-xtesting-mts-trivy'
887 container: 'xtesting-mts'
889 - 'xtesting-{repo}-{container}-{tag}-trivy'
895 sudo apt-get -o DPkg::Lock::Timeout=300 update && \
896 sudo DEBIAN_FRONTEND=noninteractive apt-get \
897 -o DPkg::Lock::Timeout=300 install curl -y
899 curl -sSfL https://raw.githubusercontent.com/anchore/grype/main/install.sh | sudo sh -s -- -b .
900 if [ "{repo}" = "_" ]; then
901 image={container}:{tag}
902 elif [ "{port}" = "None" ]; then
903 image={repo}/{container}:{tag}
905 image={repo}:{port}/{container}:{tag}
910 name: 'xtesting-{repo}-{container}-{tag}-grype'
918 <<: *xtesting-containers
924 recipients: cedric.ollivier@orange.com
927 name: 'xtesting-opnfv-xtesting-grype'
929 container: 'xtesting'
931 - 'xtesting-{repo}-{container}-{tag}-grype'
934 name: 'xtesting-opnfv-xtesting-mts-grype'
936 container: 'xtesting-mts'
938 - 'xtesting-{repo}-{container}-{tag}-grype'
944 - 'xtesting-{tag}-docker'
947 name: xtesting-docker
956 regex: ^xtesting-[a-z0-9.]+-docker$
968 regex: (?!xtesting-pi)^xtesting-[a-z-0-9.]+-trivy$
980 regex: (?!xtesting-pi)^xtesting-[a-z-0-9.]+-grype$