2 - xtesting-containers: &xtesting-containers
3 name: 'xtesting-containers'
6 container: '{container}'
9 - xtesting-params: &xtesting-params
10 name: 'xtesting-params'
29 branch: stable/wallaby
51 - xtesting-jobs: &xtesting-jobs
53 current-parameters: true
63 name: xtesting-build_tag
68 - xtesting-run-containers: &xtesting-run-containers
69 name: 'xtesting-run-containers'
70 <<: *xtesting-containers
72 privileged: '{privileged}'
80 name: xtesting-pull-containers
84 if [ "{repo}" = "_" ]; then
85 image={container}:{tag}
86 elif [ "{port}" = "None" ]; then
87 image={repo}/{container}:{tag}
89 image={repo}:{port}/{container}:{tag}
91 sudo docker pull $image
94 name: xtesting-run-containers
99 if [ "{volumes}" != "None" ]; then
100 for i in $(echo {volumes} | tr -d '[]' |sed "s/, / /g" ); \
101 do volumes="-v $i $volumes"; done
104 if [ "{env}" != "None" ]; then
105 for i in $(eval echo {env} | tr -d '[]' |sed "s/, / /g" ); \
106 do env="-e $i $env"; 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} \
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:/root/.boto \
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
135 name: xtesting-remove-images
139 if [ "{repo}" = "_" ]; then
140 image={container}:{tag}
141 elif [ "{port}" = "None" ]; then
142 image={repo}/{container}:{tag}
144 image={repo}:{port}/{container}:{tag}
146 sudo docker rmi $image || true
149 name: 'xtesting-{repo}-{container}-{tag}-pull'
154 - xtesting-pull-containers:
155 <<: *xtesting-containers
158 name: 'xtesting-opnfv-xtesting-pull'
160 container: 'xtesting'
162 - 'xtesting-{repo}-{container}-{tag}-pull'
165 name: 'xtesting-opnfv-xtesting-mts-pull'
167 container: 'xtesting-mts'
169 - 'xtesting-{repo}-{container}-{tag}-pull'
172 name: 'xtesting-{repo}-{container}-{tag}-rmi'
177 - xtesting-remove-images:
178 <<: *xtesting-containers
181 name: 'xtesting-opnfv-xtesting-rmi'
183 container: 'xtesting'
185 - 'xtesting-{repo}-{container}-{tag}-rmi'
188 name: 'xtesting-opnfv-xtesting-mts-rmi'
190 container: 'xtesting-mts'
192 - 'xtesting-{repo}-{container}-{tag}-rmi'
195 name: 'xtesting-opnfv-xtesting-{tag}-{test}-run'
199 - xtesting-build_tag:
202 - xtesting-run-containers:
203 <<: *xtesting-run-containers
206 name: 'xtesting-opnfv-xtesting'
210 container: 'xtesting'
231 - 'xtesting-opnfv-xtesting-{tag}-{test}-run'
234 name: 'xtesting-opnfv-xtesting-mts-{tag}-{test}-run'
238 - xtesting-build_tag:
241 - xtesting-run-containers:
242 <<: *xtesting-run-containers
245 name: 'xtesting-opnfv-xtesting-mts'
249 container: 'xtesting-mts'
257 - 'xtesting-opnfv-xtesting-mts-{tag}-{test}-run'
265 if [ "{volumes}" != "None" ]; then
266 for i in $(echo {volumes} | tr -d '[]' |sed "s/, / /g" ); \
267 do volumes="-v $i $volumes"; done
270 if [ "{env}" != "None" ]; then
271 for i in $(eval echo {env} | tr -d '[]' |sed "s/, / /g" ); \
272 do env="-e $i $env"; done
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}
280 image={repo}:{port}/{container}:{tag}
282 sudo docker run --rm \
285 -e S3_ENDPOINT_URL=https://storage.googleapis.com \
286 -e S3_DST_URL=s3://artifacts.opnfv.org/xtesting \
287 -e HTTP_DST_URL=http://artifacts.opnfv.org/xtesting \
288 -v /home/opnfv/xtesting/.boto:/root/.boto \
289 -e TEST_DB_URL=http://testresults.opnfv.org/test/api/v1/results \
290 -e TEST_DB_EXT_URL=http://testresults.opnfv.org/test/api/v1/results \
291 -e BUILD_TAG=$BUILD_TAG \
292 -v $WORKSPACE/../$JOB_NAME/results:/var/lib/xtesting/results \
296 name: 'xtesting-{tag}-zip'
300 - xtesting-build_tag:
304 <<: *xtesting-containers
309 name: 'xtesting-{tag}-zip'
313 container: 'xtesting'
315 - 'xtesting-{tag}-zip'
318 name: 'xtesting-{tag}-daily'
319 project-type: multijob
325 - xtesting-build_tag:
327 # PyYAML and yamllint differ here
328 # see https://github.com/yaml/pyyaml/issues/234
329 # yamllint disable rule:indentation
333 - ^xtesting-(pi-)*{tag}-(daily|docker|review)$
334 # yamllint enable rule:indentation
337 name: remove former images
339 - name: 'xtesting-opnfv-xtesting-{tag}-rmi'
341 - name: 'xtesting-opnfv-xtesting-mts-{tag}-rmi'
344 name: pull containers
346 - name: 'xtesting-opnfv-xtesting-{tag}-pull'
348 - name: 'xtesting-opnfv-xtesting-mts-{tag}-pull'
351 name: opnfv/xtesting:{tag}
353 - name: 'xtesting-opnfv-xtesting-{tag}-first-run'
355 - name: 'xtesting-opnfv-xtesting-{tag}-second-run'
357 - name: 'xtesting-opnfv-xtesting-{tag}-third-run'
359 - name: 'xtesting-opnfv-xtesting-{tag}-fourth-run'
361 - name: 'xtesting-opnfv-xtesting-{tag}-fifth-run'
363 - name: 'xtesting-opnfv-xtesting-{tag}-sixth-run'
365 - name: 'xtesting-opnfv-xtesting-{tag}-eighth-run'
368 name: opnfv/xtesting-mts:{tag}
370 - name: 'xtesting-opnfv-xtesting-mts-{tag}-seventh-run'
373 name: dump all campaign data
375 - name: 'xtesting-{tag}-zip'
382 recipients: cedric.ollivier@orange.com
385 name: 'xtesting-daily'
388 - 'xtesting-{tag}-daily'
400 regex: ^xtesting-[a-z0-9.]+-daily$
402 - xtesting-build-containers: &xtesting-build-containers
403 name: 'xtesting-build-containers'
404 <<: *xtesting-containers
407 build_args: '{build_args}'
411 name: xtesting-build-containers
415 if [ "{repo}" = "_" ]; then
416 image={container}:{tag}
417 elif [ "{port}" = "None" ]; then
418 image={repo}/{container}:{tag}
420 image={repo}:{port}/{container}:{tag}
423 if [ "{build_args}" != "None" ]; then
424 for i in $(echo {build_args} | tr -d '[]' |sed "s/, / /g" ); \
425 do build_args="--build-arg $i $build_args"; done
427 if [ "{ref_arg}" != "None" ]; then
428 build_args="$build_args --build-arg {ref_arg}={ref}"
431 if [ "{from}" != "None" ]; then
432 sed -i {from} Dockerfile
434 sudo docker build $build_args \
435 --pull=false --no-cache --force-rm=true \
442 url: 'https://gerrit.opnfv.org/gerrit/functest-xtesting'
443 refspec: '+refs/heads/*:refs/remotes/origin/* +refs/changes/*:refs/changes/*'
447 - xtesting-dep: &xtesting-dep
448 name: 'xtesting-containers'
452 dependency: '{dependency}'
455 name: xtesting-pull-dep-images
459 if [ "_" = "_" ]; then
460 image=alpine:{dependency}
461 elif [ "" = "None" ]; then
462 image=_/alpine:{dependency}
464 image=_:/alpine:{dependency}
466 sudo docker pull $image || true
469 name: xtesting-remove-dep-images
473 if [ "_" = "_" ]; then
474 image=alpine:{dependency}
475 elif [ "" = "None" ]; then
476 image=_/alpine:{dependency}
478 image=_:/alpine:{dependency}
480 sudo docker rmi $image || true
483 name: 'xtesting-{repo}-{tag}-dep-pull'
488 - xtesting-pull-dep-images:
492 name: 'xtesting-{repo}-{tag}-dep-pull'
495 - 'xtesting-{repo}-{tag}-dep-pull'
498 name: 'xtesting-{repo}-{tag}-dep-rmi'
503 - xtesting-remove-dep-images:
507 name: 'xtesting-{repo}-{tag}-dep-rmi'
510 - 'xtesting-{repo}-{tag}-dep-rmi'
517 sudo apt-get -o DPkg::Lock::Timeout=300 update && \
518 sudo DEBIAN_FRONTEND=noninteractive apt-get \
519 -o DPkg::Lock::Timeout=300 dist-upgrade -y
520 sudo DEBIAN_FRONTEND=noninteractive \
521 apt-get -o DPkg::Lock::Timeout=300 install software-properties-common gpg -y
522 sudo add-apt-repository -y ppa:deadsnakes/ppa
523 sudo apt-get -o DPkg::Lock::Timeout=300 update && \
524 sudo DEBIAN_FRONTEND=noninteractive apt-get \
525 -o DPkg::Lock::Timeout=300 install \
526 python3.9 python3.9-dev python3.9-distutils \
527 python3.8 python3.8-dev python3.8-distutils \
528 python3.7 python3.7-dev python3.6 python3.6-dev \
529 python python-dev python3-pip enchant -y
530 sudo pip3 install tox tox-pip-version
535 name: 'xtesting-{tag}-tox'
540 - xtesting-patchset-created:
552 - 'xtesting-{tag}-tox'
555 name: 'xtesting-{repo}-{container}-{tag}-gate'
563 - xtesting-build-containers:
564 <<: *xtesting-build-containers
566 build_args: '{build_args}'
569 name: xtesting-opnfv-xtesting-{tag}-gate
575 - 'xtesting-{repo}-{container}-{tag}-gate'
578 name: xtesting-opnfv-xtesting-mts-{tag}-gate
580 container: xtesting-mts
584 - 'xtesting-{repo}-{container}-{tag}-gate'
587 name: xtesting-patchset-created
591 - patchset-created-event
592 - comment-added-contains-event:
593 comment-contains-value: 'recheck'
594 - comment-added-contains-event:
595 comment-contains-value: 'reverify'
597 - project-compare-type: 'ANT'
598 project-pattern: 'functest-xtesting'
600 - branch-compare-type: 'ANT'
601 branch-pattern: '**/{branch}'
604 name: 'xtesting-{tag}-review'
605 project-type: multijob
607 - xtesting-patchset-created:
612 - xtesting-build_tag:
614 # PyYAML and yamllint differ here
615 # see https://github.com/yaml/pyyaml/issues/234
616 # yamllint disable rule:indentation
620 - ^xtesting-(pi-)*{tag}-(daily|docker|review)$
621 # yamllint enable rule:indentation
624 name: remove former images
626 - name: 'xtesting-opnfv-xtesting-{tag}-rmi'
628 - name: 'xtesting-opnfv-xtesting-mts-{tag}-rmi'
631 name: remove dependency
633 - name: 'xtesting-{repo}-{tag}-dep-rmi'
636 name: pull dependency
638 - name: 'xtesting-{repo}-{tag}-dep-pull'
643 - name: 'xtesting-opnfv-xtesting-{tag}-gate'
646 name: opnfv/xtesting-mts
648 - name: 'xtesting-opnfv-xtesting-mts-{tag}-gate'
651 name: opnfv/xtesting:{tag}
653 - name: 'xtesting-opnfv-xtesting-{tag}-first-run'
655 - name: 'xtesting-opnfv-xtesting-{tag}-second-run'
657 - name: 'xtesting-opnfv-xtesting-{tag}-third-run'
659 - name: 'xtesting-opnfv-xtesting-{tag}-fourth-run'
661 - name: 'xtesting-opnfv-xtesting-{tag}-fifth-run'
663 - name: 'xtesting-opnfv-xtesting-{tag}-sixth-run'
665 - name: 'xtesting-opnfv-xtesting-{tag}-eighth-run'
668 name: opnfv/xtesting-mts:{tag}
670 - name: 'xtesting-opnfv-xtesting-mts-{tag}-seventh-run'
677 recipients: cedric.ollivier@orange.com
680 name: 'xtesting-review'
683 - 'xtesting-{tag}-review'
686 name: xtesting-review
695 regex: ^xtesting-[a-z0-9.]+-review$
707 regex: ^xtesting-[a-z0-9.]+-tox$
710 name: xtesting-push-containers
714 if [ "{repo}" = "_" ]; then
715 image={container}:{tag}
716 elif [ "{port}" = "None" ]; then
717 image={repo}/{container}:{tag}
719 image={repo}:{port}/{container}:{tag}
721 sudo docker push $image
724 name: xtesting-commit
730 name: 'xtesting-{repo}-{container}-{tag}-build'
738 - xtesting-build-containers:
739 <<: *xtesting-build-containers
741 build_args: '{build_args}'
742 - xtesting-push-containers:
743 <<: *xtesting-build-containers
747 name: xtesting-opnfv-xtesting-{tag}-build
753 - 'xtesting-{repo}-{container}-{tag}-build'
756 name: xtesting-opnfv-xtesting-mts-{tag}-build
758 container: xtesting-mts
762 - 'xtesting-{repo}-{container}-{tag}-build'
765 name: 'xtesting-{tag}-docker'
766 project-type: multijob
775 # PyYAML and yamllint differ here
776 # see https://github.com/yaml/pyyaml/issues/234
777 # yamllint disable rule:indentation
781 - ^xtesting-(pi-)*{tag}-(daily|docker|review)$
782 # yamllint enable rule:indentation
785 name: remove dependency
787 - name: 'xtesting-{repo}-{tag}-dep-rmi'
790 name: pull dependency
792 - name: 'xtesting-{repo}-{tag}-dep-pull'
797 - name: 'xtesting-opnfv-xtesting-{tag}-build'
800 name: opnfv/xtesting-mts
802 - name: 'xtesting-opnfv-xtesting-mts-{tag}-build'
809 recipients: cedric.ollivier@orange.com
815 sudo apt-get -o DPkg::Lock::Timeout=300 update && \
816 sudo DEBIAN_FRONTEND=noninteractive apt-get \
817 -o DPkg::Lock::Timeout=300 install curl -y
819 curl -sfL https://raw.githubusercontent.com/aquasecurity/trivy/main/contrib/install.sh | sudo sh -s -- -b .
820 if [ "{repo}" = "_" ]; then
821 image={container}:{tag}
822 elif [ "{port}" = "None" ]; then
823 image={repo}/{container}:{tag}
825 image={repo}:{port}/{container}:{tag}
827 ./trivy --exit-code 1 $image
830 name: 'xtesting-{repo}-{container}-{tag}-trivy'
838 <<: *xtesting-containers
844 recipients: cedric.ollivier@orange.com
847 name: 'xtesting-opnfv-xtesting-trivy'
849 container: 'xtesting'
851 - 'xtesting-{repo}-{container}-{tag}-trivy'
854 name: 'xtesting-opnfv-xtesting-mts-trivy'
856 container: 'xtesting-mts'
858 - 'xtesting-{repo}-{container}-{tag}-trivy'
864 sudo apt-get -o DPkg::Lock::Timeout=300 update && \
865 sudo DEBIAN_FRONTEND=noninteractive apt-get \
866 -o DPkg::Lock::Timeout=300 install curl -y
868 curl -sSfL https://raw.githubusercontent.com/anchore/grype/main/install.sh | sudo sh -s -- -b .
869 if [ "{repo}" = "_" ]; then
870 image={container}:{tag}
871 elif [ "{port}" = "None" ]; then
872 image={repo}/{container}:{tag}
874 image={repo}:{port}/{container}:{tag}
879 name: 'xtesting-{repo}-{container}-{tag}-grype'
887 <<: *xtesting-containers
893 recipients: cedric.ollivier@orange.com
896 name: 'xtesting-opnfv-xtesting-grype'
898 container: 'xtesting'
900 - 'xtesting-{repo}-{container}-{tag}-grype'
903 name: 'xtesting-opnfv-xtesting-mts-grype'
905 container: 'xtesting-mts'
907 - 'xtesting-{repo}-{container}-{tag}-grype'
913 - 'xtesting-{tag}-docker'
916 name: xtesting-docker
925 regex: ^xtesting-[a-z0-9.]+-docker$
937 regex: (?!xtesting-pi)^xtesting-[a-z-0-9.]+-trivy$
949 regex: (?!xtesting-pi)^xtesting-[a-z-0-9.]+-grype$