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 name: xtesting-pull-containers
82 if [ "{repo}" = "_" ]; then
83 image={container}:{tag}
84 elif [ "{port}" = "None" ]; then
85 image={repo}/{container}:{tag}
87 image={repo}:{port}/{container}:{tag}
89 sudo docker pull $image
92 name: xtesting-run-containers
97 if [ "{volumes}" != "None" ]; then
98 for i in $(echo {volumes} | tr -d '[]' |sed "s/, / /g" ); \
99 do volumes="-v $i $volumes"; done
102 if [ "{env}" != "None" ]; then
103 for i in $(eval echo {env} | tr -d '[]' |sed "s/, / /g" ); \
104 do env="-e $i $env"; done
106 [ ! -z "$WORKSPACE" ] && sudo rm -rf $WORKSPACE/results || true
107 if [ "{repo}" = "_" ]; then
108 image={container}:{tag}
109 elif [ "{port}" = "None" ]; then
110 image={repo}/{container}:{tag}
112 image={repo}:{port}/{container}:{tag}
114 mkdir -p $WORKSPACE/../$JOB_NAME/results
115 chown opnfv: $WORKSPACE/../$JOB_NAME/results
116 sudo docker run --rm \
117 --privileged={privileged} \
118 --network={network} \
121 -e S3_ENDPOINT_URL=https://storage.googleapis.com \
122 -e S3_DST_URL=s3://artifacts.opnfv.org/xtesting/$BUILD_TAG/$JOB_NAME-$BUILD_ID \
123 -e HTTP_DST_URL=http://artifacts.opnfv.org/xtesting/$BUILD_TAG/$JOB_NAME-$BUILD_ID \
124 -v /home/opnfv/xtesting/.boto:/root/.boto \
125 -e TEST_DB_URL=http://testresults.opnfv.org/test/api/v1/results \
126 -e TEST_DB_EXT_URL=http://testresults.opnfv.org/test/api/v1/results \
127 -e NODE_NAME=$slave \
128 -e BUILD_TAG=$BUILD_TAG \
129 -v $WORKSPACE/../$JOB_NAME/results:/var/lib/xtesting/results \
130 $image run_tests -t {test} -p -r
133 name: xtesting-remove-images
137 if [ "{repo}" = "_" ]; then
138 image={container}:{tag}
139 elif [ "{port}" = "None" ]; then
140 image={repo}/{container}:{tag}
142 image={repo}:{port}/{container}:{tag}
144 sudo docker rmi $image || true
147 name: 'xtesting-{repo}-{container}-{tag}-pull'
152 - xtesting-pull-containers:
153 <<: *xtesting-containers
156 name: 'xtesting-opnfv-xtesting-pull'
158 container: 'xtesting'
160 - 'xtesting-{repo}-{container}-{tag}-pull'
163 name: 'xtesting-opnfv-xtesting-mts-pull'
165 container: 'xtesting-mts'
167 - 'xtesting-{repo}-{container}-{tag}-pull'
170 name: 'xtesting-{repo}-{container}-{tag}-rmi'
175 - xtesting-remove-images:
176 <<: *xtesting-containers
179 name: 'xtesting-opnfv-xtesting-rmi'
181 container: 'xtesting'
183 - 'xtesting-{repo}-{container}-{tag}-rmi'
186 name: 'xtesting-opnfv-xtesting-mts-rmi'
188 container: 'xtesting-mts'
190 - 'xtesting-{repo}-{container}-{tag}-rmi'
193 name: 'xtesting-opnfv-xtesting-{tag}-{test}-run'
197 - xtesting-build_tag:
200 - xtesting-run-containers:
201 <<: *xtesting-run-containers
204 name: 'xtesting-opnfv-xtesting'
208 container: 'xtesting'
227 - 'xtesting-opnfv-xtesting-{tag}-{test}-run'
230 name: 'xtesting-opnfv-xtesting-mts-{tag}-{test}-run'
234 - xtesting-build_tag:
237 - xtesting-run-containers:
238 <<: *xtesting-run-containers
241 name: 'xtesting-opnfv-xtesting-mts'
245 container: 'xtesting-mts'
251 - 'xtesting-opnfv-xtesting-mts-{tag}-{test}-run'
259 if [ "{volumes}" != "None" ]; then
260 for i in $(echo {volumes} | tr -d '[]' |sed "s/, / /g" ); \
261 do volumes="-v $i $volumes"; done
264 if [ "{env}" != "None" ]; then
265 for i in $(eval echo {env} | tr -d '[]' |sed "s/, / /g" ); \
266 do env="-e $i $env"; done
268 [ ! -z "$WORKSPACE" ] && sudo rm -rf $WORKSPACE/results || true
269 if [ "{repo}" = "_" ]; then
270 image={container}:{tag}
271 elif [ "{port}" = "None" ]; then
272 image={repo}/{container}:{tag}
274 image={repo}:{port}/{container}:{tag}
276 sudo docker run --rm \
279 -e S3_ENDPOINT_URL=https://storage.googleapis.com \
280 -e S3_DST_URL=s3://artifacts.opnfv.org/xtesting \
281 -e HTTP_DST_URL=http://artifacts.opnfv.org/xtesting \
282 -v /home/opnfv/xtesting/.boto:/root/.boto \
283 -e TEST_DB_URL=http://testresults.opnfv.org/test/api/v1/results \
284 -e TEST_DB_EXT_URL=http://testresults.opnfv.org/test/api/v1/results \
285 -e BUILD_TAG=$BUILD_TAG \
286 -v $WORKSPACE/../$JOB_NAME/results:/var/lib/xtesting/results \
290 name: 'xtesting-{tag}-zip'
294 - xtesting-build_tag:
298 <<: *xtesting-containers
303 name: 'xtesting-{tag}-zip'
307 container: 'xtesting'
309 - 'xtesting-{tag}-zip'
312 name: 'xtesting-{tag}-daily'
313 project-type: multijob
319 - xtesting-build_tag:
321 # PyYAML and yamllint differ here
322 # see https://github.com/yaml/pyyaml/issues/234
323 # yamllint disable rule:indentation
327 - ^xtesting-(pi-)*{tag}-(daily|docker|review)$
328 # yamllint enable rule:indentation
331 name: remove former images
333 - name: 'xtesting-opnfv-xtesting-{tag}-rmi'
335 - name: 'xtesting-opnfv-xtesting-mts-{tag}-rmi'
338 name: pull containers
340 - name: 'xtesting-opnfv-xtesting-{tag}-pull'
342 - name: 'xtesting-opnfv-xtesting-mts-{tag}-pull'
345 name: opnfv/xtesting:{tag}
347 - name: 'xtesting-opnfv-xtesting-{tag}-first-run'
349 - name: 'xtesting-opnfv-xtesting-{tag}-second-run'
351 - name: 'xtesting-opnfv-xtesting-{tag}-third-run'
353 - name: 'xtesting-opnfv-xtesting-{tag}-fourth-run'
355 - name: 'xtesting-opnfv-xtesting-{tag}-fifth-run'
357 - name: 'xtesting-opnfv-xtesting-{tag}-sixth-run'
359 - name: 'xtesting-opnfv-xtesting-{tag}-eighth-run'
362 name: opnfv/xtesting-mts:{tag}
364 - name: 'xtesting-opnfv-xtesting-mts-{tag}-seventh-run'
367 name: dump all campaign data
369 - name: 'xtesting-{tag}-zip'
376 recipients: cedric.ollivier@orange.com
379 name: 'xtesting-daily'
382 - 'xtesting-{tag}-daily'
394 regex: ^xtesting-[a-z0-9.]+-daily$
396 - xtesting-build-containers: &xtesting-build-containers
397 name: 'xtesting-build-containers'
398 <<: *xtesting-containers
401 build_args: '{build_args}'
405 name: xtesting-build-containers
409 if [ "{repo}" = "_" ]; then
410 image={container}:{tag}
411 elif [ "{port}" = "None" ]; then
412 image={repo}/{container}:{tag}
414 image={repo}:{port}/{container}:{tag}
417 if [ "{build_args}" != "None" ]; then
418 for i in $(echo {build_args} | tr -d '[]' |sed "s/, / /g" ); \
419 do build_args="--build-arg $i $build_args"; done
421 if [ "{ref_arg}" != "None" ]; then
422 build_args="$build_args --build-arg {ref_arg}={ref}"
425 if [ "{from}" != "None" ]; then
426 sed -i {from} Dockerfile
428 sudo docker build $build_args \
429 --pull=false --no-cache --force-rm=true \
436 url: 'https://gerrit.opnfv.org/gerrit/functest-xtesting'
437 refspec: '+refs/heads/*:refs/remotes/origin/* +refs/changes/*:refs/changes/*'
441 - xtesting-dep: &xtesting-dep
442 name: 'xtesting-containers'
446 dependency: '{dependency}'
449 name: xtesting-pull-dep-images
453 if [ "_" = "_" ]; then
454 image=alpine:{dependency}
455 elif [ "" = "None" ]; then
456 image=_/alpine:{dependency}
458 image=_:/alpine:{dependency}
460 sudo docker pull $image || true
463 name: xtesting-remove-dep-images
467 if [ "_" = "_" ]; then
468 image=alpine:{dependency}
469 elif [ "" = "None" ]; then
470 image=_/alpine:{dependency}
472 image=_:/alpine:{dependency}
474 sudo docker rmi $image || true
477 name: 'xtesting-{repo}-{tag}-dep-pull'
482 - xtesting-pull-dep-images:
486 name: 'xtesting-{repo}-{tag}-dep-pull'
489 - 'xtesting-{repo}-{tag}-dep-pull'
492 name: 'xtesting-{repo}-{tag}-dep-rmi'
497 - xtesting-remove-dep-images:
501 name: 'xtesting-{repo}-{tag}-dep-rmi'
504 - 'xtesting-{repo}-{tag}-dep-rmi'
511 sudo apt-get -o DPkg::Lock::Timeout=300 update && \
512 sudo DEBIAN_FRONTEND=noninteractive apt-get \
513 -o DPkg::Lock::Timeout=300 dist-upgrade -y
514 sudo DEBIAN_FRONTEND=noninteractive \
515 apt-get -o DPkg::Lock::Timeout=300 install software-properties-common gpg -y
516 sudo add-apt-repository -y ppa:deadsnakes/ppa
517 sudo apt-get -o DPkg::Lock::Timeout=300 update && \
518 sudo DEBIAN_FRONTEND=noninteractive apt-get \
519 -o DPkg::Lock::Timeout=300 install \
520 python3.9 python3.9-dev python3.9-distutils \
521 python3.8 python3.8-dev python3.8-distutils \
522 python3.7 python3.7-dev python3.6 python3.6-dev \
523 python python-dev python3-pip enchant -y
524 sudo pip3 install tox tox-pip-version
529 name: 'xtesting-{tag}-tox'
534 - xtesting-patchset-created:
546 - 'xtesting-{tag}-tox'
549 name: 'xtesting-{repo}-{container}-{tag}-gate'
557 - xtesting-build-containers:
558 <<: *xtesting-build-containers
560 build_args: '{build_args}'
563 name: xtesting-opnfv-xtesting-{tag}-gate
569 - 'xtesting-{repo}-{container}-{tag}-gate'
572 name: xtesting-opnfv-xtesting-mts-{tag}-gate
574 container: xtesting-mts
578 - 'xtesting-{repo}-{container}-{tag}-gate'
581 name: xtesting-patchset-created
585 - patchset-created-event
586 - comment-added-contains-event:
587 comment-contains-value: 'recheck'
588 - comment-added-contains-event:
589 comment-contains-value: 'reverify'
591 - project-compare-type: 'ANT'
592 project-pattern: 'functest-xtesting'
594 - branch-compare-type: 'ANT'
595 branch-pattern: '**/{branch}'
598 name: 'xtesting-{tag}-review'
599 project-type: multijob
601 - xtesting-patchset-created:
606 - xtesting-build_tag:
608 # PyYAML and yamllint differ here
609 # see https://github.com/yaml/pyyaml/issues/234
610 # yamllint disable rule:indentation
614 - ^xtesting-(pi-)*{tag}-(daily|docker|review)$
615 # yamllint enable rule:indentation
618 name: remove former images
620 - name: 'xtesting-opnfv-xtesting-{tag}-rmi'
622 - name: 'xtesting-opnfv-xtesting-mts-{tag}-rmi'
625 name: remove dependency
627 - name: 'xtesting-{repo}-{tag}-dep-rmi'
630 name: pull dependency
632 - name: 'xtesting-{repo}-{tag}-dep-pull'
637 - name: 'xtesting-opnfv-xtesting-{tag}-gate'
640 name: opnfv/xtesting-mts
642 - name: 'xtesting-opnfv-xtesting-mts-{tag}-gate'
645 name: opnfv/xtesting:{tag}
647 - name: 'xtesting-opnfv-xtesting-{tag}-first-run'
649 - name: 'xtesting-opnfv-xtesting-{tag}-second-run'
651 - name: 'xtesting-opnfv-xtesting-{tag}-third-run'
653 - name: 'xtesting-opnfv-xtesting-{tag}-fourth-run'
655 - name: 'xtesting-opnfv-xtesting-{tag}-fifth-run'
657 - name: 'xtesting-opnfv-xtesting-{tag}-sixth-run'
659 - name: 'xtesting-opnfv-xtesting-{tag}-eighth-run'
662 name: opnfv/xtesting-mts:{tag}
664 - name: 'xtesting-opnfv-xtesting-mts-{tag}-seventh-run'
671 recipients: cedric.ollivier@orange.com
674 name: 'xtesting-review'
677 - 'xtesting-{tag}-review'
680 name: xtesting-review
689 regex: ^xtesting-[a-z0-9.]+-review$
701 regex: ^xtesting-[a-z0-9.]+-tox$
704 name: xtesting-push-containers
708 if [ "{repo}" = "_" ]; then
709 image={container}:{tag}
710 elif [ "{port}" = "None" ]; then
711 image={repo}/{container}:{tag}
713 image={repo}:{port}/{container}:{tag}
715 sudo docker push $image
718 name: xtesting-commit
724 name: 'xtesting-{repo}-{container}-{tag}-build'
732 - xtesting-build-containers:
733 <<: *xtesting-build-containers
735 build_args: '{build_args}'
736 - xtesting-push-containers:
737 <<: *xtesting-build-containers
741 name: xtesting-opnfv-xtesting-{tag}-build
747 - 'xtesting-{repo}-{container}-{tag}-build'
750 name: xtesting-opnfv-xtesting-mts-{tag}-build
752 container: xtesting-mts
756 - 'xtesting-{repo}-{container}-{tag}-build'
759 name: 'xtesting-{tag}-docker'
760 project-type: multijob
769 # PyYAML and yamllint differ here
770 # see https://github.com/yaml/pyyaml/issues/234
771 # yamllint disable rule:indentation
775 - ^xtesting-(pi-)*{tag}-(daily|docker|review)$
776 # yamllint enable rule:indentation
779 name: remove dependency
781 - name: 'xtesting-{repo}-{tag}-dep-rmi'
784 name: pull dependency
786 - name: 'xtesting-{repo}-{tag}-dep-pull'
791 - name: 'xtesting-opnfv-xtesting-{tag}-build'
794 name: opnfv/xtesting-mts
796 - name: 'xtesting-opnfv-xtesting-mts-{tag}-build'
803 recipients: cedric.ollivier@orange.com
809 sudo apt-get -o DPkg::Lock::Timeout=300 update && \
810 sudo DEBIAN_FRONTEND=noninteractive apt-get \
811 -o DPkg::Lock::Timeout=300 install curl -y
813 curl -sfL https://raw.githubusercontent.com/aquasecurity/trivy/main/contrib/install.sh | sudo sh -s -- -b .
814 if [ "{repo}" = "_" ]; then
815 image={container}:{tag}
816 elif [ "{port}" = "None" ]; then
817 image={repo}/{container}:{tag}
819 image={repo}:{port}/{container}:{tag}
821 ./trivy --exit-code 1 $image
824 name: 'xtesting-{repo}-{container}-{tag}-trivy'
832 <<: *xtesting-containers
838 recipients: cedric.ollivier@orange.com
841 name: 'xtesting-opnfv-xtesting-trivy'
843 container: 'xtesting'
845 - 'xtesting-{repo}-{container}-{tag}-trivy'
848 name: 'xtesting-opnfv-xtesting-mts-trivy'
850 container: 'xtesting-mts'
852 - 'xtesting-{repo}-{container}-{tag}-trivy'
858 sudo apt-get -o DPkg::Lock::Timeout=300 update && \
859 sudo DEBIAN_FRONTEND=noninteractive apt-get \
860 -o DPkg::Lock::Timeout=300 install curl -y
862 curl -sSfL https://raw.githubusercontent.com/anchore/grype/main/install.sh | sudo sh -s -- -b .
863 if [ "{repo}" = "_" ]; then
864 image={container}:{tag}
865 elif [ "{port}" = "None" ]; then
866 image={repo}/{container}:{tag}
868 image={repo}:{port}/{container}:{tag}
873 name: 'xtesting-{repo}-{container}-{tag}-grype'
881 <<: *xtesting-containers
887 recipients: cedric.ollivier@orange.com
890 name: 'xtesting-opnfv-xtesting-grype'
892 container: 'xtesting'
894 - 'xtesting-{repo}-{container}-{tag}-grype'
897 name: 'xtesting-opnfv-xtesting-mts-grype'
899 container: 'xtesting-mts'
901 - 'xtesting-{repo}-{container}-{tag}-grype'
907 - 'xtesting-{tag}-docker'
910 name: xtesting-docker
919 regex: ^xtesting-[a-z0-9.]+-docker$
931 regex: (?!xtesting-pi)^xtesting-[a-z-0-9.]+-trivy$
943 regex: (?!xtesting-pi)^xtesting-[a-z-0-9.]+-grype$