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}'
78 published_ports: '{published_ports}'
81 name: xtesting-pull-containers
85 if [ "{repo}" = "_" ]; then
86 image={container}:{tag}
87 elif [ "{port}" = "None" ]; then
88 image={repo}/{container}:{tag}
90 image={repo}:{port}/{container}:{tag}
92 sudo docker pull $image
95 name: xtesting-run-containers
100 if [ "{volumes}" != "None" ]; then
101 for i in $(echo {volumes} | tr -d '[]' |sed "s/, / /g" ); \
102 do volumes="-v $i $volumes"; done
105 if [ "{env}" != "None" ]; then
106 for i in $(eval echo {env} | tr -d '[]' |sed "s/, / /g" ); \
107 do env="-e $i $env"; done
110 if [ "{published_ports}" != "None" ]; then
111 for i in $(echo {published_ports} | tr -d '[]' |sed "s/, / /g" ); \
112 do published_ports="-p $i $published_ports"; done
114 [ ! -z "$WORKSPACE" ] && sudo rm -rf $WORKSPACE/results || true
115 if [ "{repo}" = "_" ]; then
116 image={container}:{tag}
117 elif [ "{port}" = "None" ]; then
118 image={repo}/{container}:{tag}
120 image={repo}:{port}/{container}:{tag}
122 sudo mkdir -p $WORKSPACE/results
123 sudo chown {uid}:{gid} $WORKSPACE/results
124 sudo docker run --rm \
125 --privileged={privileged} \
126 --network={network} \
130 -e S3_ENDPOINT_URL=https://storage.googleapis.com \
131 -e S3_DST_URL=s3://artifacts.opnfv.org/xtesting/$BUILD_TAG/$JOB_NAME-$BUILD_ID \
132 -e HTTP_DST_URL=http://artifacts.opnfv.org/xtesting/$BUILD_TAG/$JOB_NAME-$BUILD_ID \
133 -v /home/opnfv/xtesting/.boto:/etc/boto.cfg \
134 -e TEST_DB_URL=http://testresults.opnfv.org/test/api/v1/results \
135 -e TEST_DB_EXT_URL=http://testresults.opnfv.org/test/api/v1/results \
136 -e NODE_NAME=$slave \
137 -e BUILD_TAG=$BUILD_TAG \
138 -v $WORKSPACE/../$JOB_NAME/results:/var/lib/xtesting/results \
139 $image run_tests -t {test} -p -r
142 name: xtesting-remove-images
146 if [ "{repo}" = "_" ]; then
147 image={container}:{tag}
148 elif [ "{port}" = "None" ]; then
149 image={repo}/{container}:{tag}
151 image={repo}:{port}/{container}:{tag}
153 sudo docker rmi $image || true
156 name: 'xtesting-{repo}-{container}-{tag}-pull'
161 - xtesting-pull-containers:
162 <<: *xtesting-containers
165 name: 'xtesting-opnfv-xtesting-pull'
167 container: 'xtesting'
169 - 'xtesting-{repo}-{container}-{tag}-pull'
172 name: 'xtesting-opnfv-xtesting-mts-pull'
174 container: 'xtesting-mts'
176 - 'xtesting-{repo}-{container}-{tag}-pull'
179 name: 'xtesting-{repo}-{container}-{tag}-rmi'
184 - xtesting-remove-images:
185 <<: *xtesting-containers
188 name: 'xtesting-opnfv-xtesting-rmi'
190 container: 'xtesting'
192 - 'xtesting-{repo}-{container}-{tag}-rmi'
195 name: 'xtesting-opnfv-xtesting-mts-rmi'
197 container: 'xtesting-mts'
199 - 'xtesting-{repo}-{container}-{tag}-rmi'
202 name: 'xtesting-opnfv-xtesting-{tag}-{test}-run'
206 - xtesting-build_tag:
209 - xtesting-run-containers:
210 <<: *xtesting-run-containers
213 name: 'xtesting-opnfv-xtesting'
218 container: 'xtesting'
239 - 'xtesting-opnfv-xtesting-{tag}-{test}-run'
242 name: 'xtesting-opnfv-xtesting-mts-{tag}-{test}-run'
246 - xtesting-build_tag:
249 - xtesting-run-containers:
250 <<: *xtesting-run-containers
253 name: 'xtesting-opnfv-xtesting-mts'
258 container: 'xtesting-mts'
266 - 'xtesting-opnfv-xtesting-mts-{tag}-{test}-run'
274 if [ "{volumes}" != "None" ]; then
275 for i in $(echo {volumes} | tr -d '[]' |sed "s/, / /g" ); \
276 do volumes="-v $i $volumes"; done
279 if [ "{env}" != "None" ]; then
280 for i in $(eval echo {env} | tr -d '[]' |sed "s/, / /g" ); \
281 do env="-e $i $env"; done
284 if [ "{published_ports}" != "None" ]; then
285 for i in $(echo {published_ports} | tr -d '[]' |sed "s/, / /g" ); \
286 do published_ports="-p $i $published_ports"; done
288 [ ! -z "$WORKSPACE" ] && sudo rm -rf $WORKSPACE/results || true
289 if [ "{repo}" = "_" ]; then
290 image={container}:{tag}
291 elif [ "{port}" = "None" ]; then
292 image={repo}/{container}:{tag}
294 image={repo}:{port}/{container}:{tag}
296 sudo mkdir -p $WORKSPACE/results
297 sudo chown {uid}:{gid} $WORKSPACE/results
298 sudo docker run --rm \
302 -e S3_ENDPOINT_URL=https://storage.googleapis.com \
303 -e S3_DST_URL=s3://artifacts.opnfv.org/xtesting \
304 -e HTTP_DST_URL=http://artifacts.opnfv.org/xtesting \
305 -v /home/opnfv/xtesting/.boto:/etc/boto.cfg \
306 -e TEST_DB_URL=http://testresults.opnfv.org/test/api/v1/results \
307 -e TEST_DB_EXT_URL=http://testresults.opnfv.org/test/api/v1/results \
308 -e BUILD_TAG=$BUILD_TAG \
309 -v $WORKSPACE/../$JOB_NAME/results:/var/lib/xtesting/results \
313 name: 'xtesting-{tag}-zip'
317 - xtesting-build_tag:
321 <<: *xtesting-containers
326 published_ports: '{published_ports}'
329 name: 'xtesting-{tag}-zip'
334 container: 'xtesting'
338 - 'xtesting-{tag}-zip'
341 name: 'xtesting-{tag}-daily'
342 project-type: multijob
348 - xtesting-build_tag:
350 # PyYAML and yamllint differ here
351 # see https://github.com/yaml/pyyaml/issues/234
352 # yamllint disable rule:indentation
356 - ^xtesting-(pi-)*{tag}-(daily|docker|review)$
357 # yamllint enable rule:indentation
360 name: remove former images
362 - name: 'xtesting-opnfv-xtesting-{tag}-rmi'
364 - name: 'xtesting-opnfv-xtesting-mts-{tag}-rmi'
367 name: pull containers
369 - name: 'xtesting-opnfv-xtesting-{tag}-pull'
371 - name: 'xtesting-opnfv-xtesting-mts-{tag}-pull'
374 name: opnfv/xtesting:{tag}
376 - name: 'xtesting-opnfv-xtesting-{tag}-first-run'
378 - name: 'xtesting-opnfv-xtesting-{tag}-second-run'
380 - name: 'xtesting-opnfv-xtesting-{tag}-third-run'
382 - name: 'xtesting-opnfv-xtesting-{tag}-fourth-run'
384 - name: 'xtesting-opnfv-xtesting-{tag}-fifth-run'
386 - name: 'xtesting-opnfv-xtesting-{tag}-sixth-run'
388 - name: 'xtesting-opnfv-xtesting-{tag}-eighth-run'
391 name: opnfv/xtesting-mts:{tag}
393 - name: 'xtesting-opnfv-xtesting-mts-{tag}-seventh-run'
396 name: dump all campaign data
398 - name: 'xtesting-{tag}-zip'
405 recipients: cedric.ollivier@orange.com
408 name: 'xtesting-daily'
411 - 'xtesting-{tag}-daily'
423 regex: ^xtesting-[a-z0-9.]+-daily$
425 - xtesting-build-containers: &xtesting-build-containers
426 name: 'xtesting-build-containers'
427 <<: *xtesting-containers
430 build_args: '{build_args}'
434 name: xtesting-build-containers
438 if [ "{repo}" = "_" ]; then
439 image={container}:{tag}
440 elif [ "{port}" = "None" ]; then
441 image={repo}/{container}:{tag}
443 image={repo}:{port}/{container}:{tag}
446 if [ "{build_args}" != "None" ]; then
447 for i in $(echo {build_args} | tr -d '[]' |sed "s/, / /g" ); \
448 do build_args="--build-arg $i $build_args"; done
450 if [ "{ref_arg}" != "None" ]; then
451 build_args="$build_args --build-arg {ref_arg}={ref}"
454 if [ "{from}" != "None" ]; then
455 sed -i {from} Dockerfile
457 sudo docker build $build_args \
458 --pull=false --no-cache --force-rm=true \
465 url: 'https://gerrit.opnfv.org/gerrit/functest-xtesting'
466 refspec: '+refs/heads/*:refs/remotes/origin/* +refs/changes/*:refs/changes/*'
470 - xtesting-dep: &xtesting-dep
471 name: 'xtesting-containers'
475 dependency: '{dependency}'
478 name: xtesting-pull-dep-images
482 if [ "_" = "_" ]; then
483 image=alpine:{dependency}
484 elif [ "" = "None" ]; then
485 image=_/alpine:{dependency}
487 image=_:/alpine:{dependency}
489 sudo docker pull $image || true
492 name: xtesting-remove-dep-images
496 if [ "_" = "_" ]; then
497 image=alpine:{dependency}
498 elif [ "" = "None" ]; then
499 image=_/alpine:{dependency}
501 image=_:/alpine:{dependency}
503 sudo docker rmi $image || true
506 name: 'xtesting-{repo}-{tag}-dep-pull'
511 - xtesting-pull-dep-images:
515 name: 'xtesting-{repo}-{tag}-dep-pull'
518 - 'xtesting-{repo}-{tag}-dep-pull'
521 name: 'xtesting-{repo}-{tag}-dep-rmi'
526 - xtesting-remove-dep-images:
530 name: 'xtesting-{repo}-{tag}-dep-rmi'
533 - 'xtesting-{repo}-{tag}-dep-rmi'
540 sudo apt-get -o DPkg::Lock::Timeout=300 update && \
541 sudo DEBIAN_FRONTEND=noninteractive apt-get \
542 -o DPkg::Lock::Timeout=300 dist-upgrade -y
543 sudo DEBIAN_FRONTEND=noninteractive \
544 apt-get -o DPkg::Lock::Timeout=300 install software-properties-common gpg -y
545 sudo add-apt-repository -y ppa:deadsnakes/ppa
546 sudo apt-get -o DPkg::Lock::Timeout=300 update && \
547 sudo DEBIAN_FRONTEND=noninteractive apt-get \
548 -o DPkg::Lock::Timeout=300 install \
549 python3.9 python3.9-dev python3.9-distutils \
550 python3.8 python3.8-dev python3.8-distutils \
551 python3.7 python3.7-dev python3.6 python3.6-dev \
552 python python-dev python3-pip enchant -y
553 sudo pip3 install tox tox-pip-version
558 name: 'xtesting-{tag}-tox'
563 - xtesting-patchset-created:
575 - 'xtesting-{tag}-tox'
578 name: 'xtesting-{repo}-{container}-{tag}-gate'
586 - xtesting-build-containers:
587 <<: *xtesting-build-containers
589 build_args: '{build_args}'
592 name: xtesting-opnfv-xtesting-{tag}-gate
598 - 'xtesting-{repo}-{container}-{tag}-gate'
601 name: xtesting-opnfv-xtesting-mts-{tag}-gate
603 container: xtesting-mts
607 - 'xtesting-{repo}-{container}-{tag}-gate'
610 name: xtesting-patchset-created
614 - patchset-created-event
615 - comment-added-contains-event:
616 comment-contains-value: 'recheck'
617 - comment-added-contains-event:
618 comment-contains-value: 'reverify'
620 - project-compare-type: 'ANT'
621 project-pattern: 'functest-xtesting'
623 - branch-compare-type: 'ANT'
624 branch-pattern: '**/{branch}'
627 name: 'xtesting-{tag}-review'
628 project-type: multijob
630 - xtesting-patchset-created:
635 - xtesting-build_tag:
637 # PyYAML and yamllint differ here
638 # see https://github.com/yaml/pyyaml/issues/234
639 # yamllint disable rule:indentation
643 - ^xtesting-(pi-)*{tag}-(daily|docker|review)$
644 # yamllint enable rule:indentation
647 name: remove former images
649 - name: 'xtesting-opnfv-xtesting-{tag}-rmi'
651 - name: 'xtesting-opnfv-xtesting-mts-{tag}-rmi'
654 name: remove dependency
656 - name: 'xtesting-{repo}-{tag}-dep-rmi'
659 name: pull dependency
661 - name: 'xtesting-{repo}-{tag}-dep-pull'
666 - name: 'xtesting-opnfv-xtesting-{tag}-gate'
669 name: opnfv/xtesting-mts
671 - name: 'xtesting-opnfv-xtesting-mts-{tag}-gate'
674 name: opnfv/xtesting:{tag}
676 - name: 'xtesting-opnfv-xtesting-{tag}-first-run'
678 - name: 'xtesting-opnfv-xtesting-{tag}-second-run'
680 - name: 'xtesting-opnfv-xtesting-{tag}-third-run'
682 - name: 'xtesting-opnfv-xtesting-{tag}-fourth-run'
684 - name: 'xtesting-opnfv-xtesting-{tag}-fifth-run'
686 - name: 'xtesting-opnfv-xtesting-{tag}-sixth-run'
688 - name: 'xtesting-opnfv-xtesting-{tag}-eighth-run'
691 name: opnfv/xtesting-mts:{tag}
693 - name: 'xtesting-opnfv-xtesting-mts-{tag}-seventh-run'
700 recipients: cedric.ollivier@orange.com
703 name: 'xtesting-review'
706 - 'xtesting-{tag}-review'
709 name: xtesting-review
718 regex: ^xtesting-[a-z0-9.]+-review$
730 regex: ^xtesting-[a-z0-9.]+-tox$
733 name: xtesting-push-containers
737 if [ "{repo}" = "_" ]; then
738 image={container}:{tag}
739 elif [ "{port}" = "None" ]; then
740 image={repo}/{container}:{tag}
742 image={repo}:{port}/{container}:{tag}
744 sudo docker push $image
747 name: xtesting-commit
753 name: 'xtesting-{repo}-{container}-{tag}-build'
761 - xtesting-build-containers:
762 <<: *xtesting-build-containers
764 build_args: '{build_args}'
765 - xtesting-push-containers:
766 <<: *xtesting-build-containers
770 name: xtesting-opnfv-xtesting-{tag}-build
776 - 'xtesting-{repo}-{container}-{tag}-build'
779 name: xtesting-opnfv-xtesting-mts-{tag}-build
781 container: xtesting-mts
785 - 'xtesting-{repo}-{container}-{tag}-build'
788 name: 'xtesting-{tag}-docker'
789 project-type: multijob
798 # PyYAML and yamllint differ here
799 # see https://github.com/yaml/pyyaml/issues/234
800 # yamllint disable rule:indentation
804 - ^xtesting-(pi-)*{tag}-(daily|docker|review)$
805 # yamllint enable rule:indentation
808 name: remove dependency
810 - name: 'xtesting-{repo}-{tag}-dep-rmi'
813 name: pull dependency
815 - name: 'xtesting-{repo}-{tag}-dep-pull'
820 - name: 'xtesting-opnfv-xtesting-{tag}-build'
823 name: opnfv/xtesting-mts
825 - name: 'xtesting-opnfv-xtesting-mts-{tag}-build'
832 recipients: cedric.ollivier@orange.com
838 sudo apt-get -o DPkg::Lock::Timeout=300 update && \
839 sudo DEBIAN_FRONTEND=noninteractive apt-get \
840 -o DPkg::Lock::Timeout=300 install curl -y
842 curl -sfL https://raw.githubusercontent.com/aquasecurity/trivy/main/contrib/install.sh | sudo sh -s -- -b .
843 if [ "{repo}" = "_" ]; then
844 image={container}:{tag}
845 elif [ "{port}" = "None" ]; then
846 image={repo}/{container}:{tag}
848 image={repo}:{port}/{container}:{tag}
853 name: 'xtesting-{repo}-{container}-{tag}-trivy'
861 <<: *xtesting-containers
867 recipients: cedric.ollivier@orange.com
870 name: 'xtesting-opnfv-xtesting-trivy'
872 container: 'xtesting'
874 - 'xtesting-{repo}-{container}-{tag}-trivy'
877 name: 'xtesting-opnfv-xtesting-mts-trivy'
879 container: 'xtesting-mts'
881 - 'xtesting-{repo}-{container}-{tag}-trivy'
887 sudo apt-get -o DPkg::Lock::Timeout=300 update && \
888 sudo DEBIAN_FRONTEND=noninteractive apt-get \
889 -o DPkg::Lock::Timeout=300 install curl -y
891 curl -sSfL https://raw.githubusercontent.com/anchore/grype/main/install.sh | sudo sh -s -- -b .
892 if [ "{repo}" = "_" ]; then
893 image={container}:{tag}
894 elif [ "{port}" = "None" ]; then
895 image={repo}/{container}:{tag}
897 image={repo}:{port}/{container}:{tag}
902 name: 'xtesting-{repo}-{container}-{tag}-grype'
910 <<: *xtesting-containers
916 recipients: cedric.ollivier@orange.com
919 name: 'xtesting-opnfv-xtesting-grype'
921 container: 'xtesting'
923 - 'xtesting-{repo}-{container}-{tag}-grype'
926 name: 'xtesting-opnfv-xtesting-mts-grype'
928 container: 'xtesting-mts'
930 - 'xtesting-{repo}-{container}-{tag}-grype'
936 - 'xtesting-{tag}-docker'
939 name: xtesting-docker
948 regex: ^xtesting-[a-z0-9.]+-docker$
960 regex: (?!xtesting-pi)^xtesting-[a-z-0-9.]+-trivy$
972 regex: (?!xtesting-pi)^xtesting-[a-z-0-9.]+-grype$