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 sudo docker run --rm \
115 --privileged={privileged} \
116 --network={network} \
119 -e S3_ENDPOINT_URL=https://storage.googleapis.com \
120 -e S3_DST_URL=s3://artifacts.opnfv.org/xtesting/$BUILD_TAG/$JOB_NAME-$BUILD_ID \
121 -e HTTP_DST_URL=http://artifacts.opnfv.org/xtesting/$BUILD_TAG/$JOB_NAME-$BUILD_ID \
122 -v /home/opnfv/xtesting/.boto:/root/.boto \
123 -e TEST_DB_URL=http://testresults.opnfv.org/test/api/v1/results \
124 -e TEST_DB_EXT_URL=http://testresults.opnfv.org/test/api/v1/results \
125 -e NODE_NAME=$slave \
126 -e BUILD_TAG=$BUILD_TAG \
127 -v $WORKSPACE/../$JOB_NAME/results:/var/lib/xtesting/results \
128 $image run_tests -t {test} -p -r
131 name: xtesting-remove-images
135 if [ "{repo}" = "_" ]; then
136 image={container}:{tag}
137 elif [ "{port}" = "None" ]; then
138 image={repo}/{container}:{tag}
140 image={repo}:{port}/{container}:{tag}
142 sudo docker rmi $image || true
145 name: 'xtesting-{repo}-{container}-{tag}-pull'
150 - xtesting-pull-containers:
151 <<: *xtesting-containers
154 name: 'xtesting-opnfv-xtesting-pull'
156 container: 'xtesting'
158 - 'xtesting-{repo}-{container}-{tag}-pull'
161 name: 'xtesting-opnfv-xtesting-mts-pull'
163 container: 'xtesting-mts'
165 - 'xtesting-{repo}-{container}-{tag}-pull'
168 name: 'xtesting-{repo}-{container}-{tag}-rmi'
173 - xtesting-remove-images:
174 <<: *xtesting-containers
177 name: 'xtesting-opnfv-xtesting-rmi'
179 container: 'xtesting'
181 - 'xtesting-{repo}-{container}-{tag}-rmi'
184 name: 'xtesting-opnfv-xtesting-mts-rmi'
186 container: 'xtesting-mts'
188 - 'xtesting-{repo}-{container}-{tag}-rmi'
191 name: 'xtesting-opnfv-xtesting-{tag}-{test}-run'
195 - xtesting-build_tag:
198 - xtesting-run-containers:
199 <<: *xtesting-run-containers
202 name: 'xtesting-opnfv-xtesting'
206 container: 'xtesting'
225 - 'xtesting-opnfv-xtesting-{tag}-{test}-run'
228 name: 'xtesting-opnfv-xtesting-mts-{tag}-{test}-run'
232 - xtesting-build_tag:
235 - xtesting-run-containers:
236 <<: *xtesting-run-containers
239 name: 'xtesting-opnfv-xtesting-mts'
243 container: 'xtesting-mts'
249 - 'xtesting-opnfv-xtesting-mts-{tag}-{test}-run'
257 if [ "{volumes}" != "None" ]; then
258 for i in $(echo {volumes} | tr -d '[]' |sed "s/, / /g" ); \
259 do volumes="-v $i $volumes"; done
262 if [ "{env}" != "None" ]; then
263 for i in $(eval echo {env} | tr -d '[]' |sed "s/, / /g" ); \
264 do env="-e $i $env"; done
266 [ ! -z "$WORKSPACE" ] && sudo rm -rf $WORKSPACE/results || true
267 if [ "{repo}" = "_" ]; then
268 image={container}:{tag}
269 elif [ "{port}" = "None" ]; then
270 image={repo}/{container}:{tag}
272 image={repo}:{port}/{container}:{tag}
274 sudo docker run --rm \
277 -e S3_ENDPOINT_URL=https://storage.googleapis.com \
278 -e S3_DST_URL=s3://artifacts.opnfv.org/xtesting \
279 -e HTTP_DST_URL=http://artifacts.opnfv.org/xtesting \
280 -v /home/opnfv/xtesting/.boto:/root/.boto \
281 -e TEST_DB_URL=http://testresults.opnfv.org/test/api/v1/results \
282 -e TEST_DB_EXT_URL=http://testresults.opnfv.org/test/api/v1/results \
283 -e BUILD_TAG=$BUILD_TAG \
284 -v $WORKSPACE/../$JOB_NAME/results:/var/lib/xtesting/results \
288 name: 'xtesting-{tag}-zip'
292 - xtesting-build_tag:
296 <<: *xtesting-containers
301 name: 'xtesting-{tag}-zip'
305 container: 'xtesting'
307 - 'xtesting-{tag}-zip'
310 name: 'xtesting-{tag}-daily'
311 project-type: multijob
317 - xtesting-build_tag:
319 # PyYAML and yamllint differ here
320 # see https://github.com/yaml/pyyaml/issues/234
321 # yamllint disable rule:indentation
325 - ^xtesting-(pi-)*{tag}-(daily|docker|review)$
326 # yamllint enable rule:indentation
329 name: remove former images
331 - name: 'xtesting-opnfv-xtesting-{tag}-rmi'
333 - name: 'xtesting-opnfv-xtesting-mts-{tag}-rmi'
336 name: pull containers
338 - name: 'xtesting-opnfv-xtesting-{tag}-pull'
340 - name: 'xtesting-opnfv-xtesting-mts-{tag}-pull'
343 name: opnfv/xtesting:{tag}
345 - name: 'xtesting-opnfv-xtesting-{tag}-first-run'
347 - name: 'xtesting-opnfv-xtesting-{tag}-second-run'
349 - name: 'xtesting-opnfv-xtesting-{tag}-third-run'
351 - name: 'xtesting-opnfv-xtesting-{tag}-fourth-run'
353 - name: 'xtesting-opnfv-xtesting-{tag}-fifth-run'
355 - name: 'xtesting-opnfv-xtesting-{tag}-sixth-run'
357 - name: 'xtesting-opnfv-xtesting-{tag}-eighth-run'
360 name: opnfv/xtesting-mts:{tag}
362 - name: 'xtesting-opnfv-xtesting-mts-{tag}-seventh-run'
365 name: dump all campaign data
367 - name: 'xtesting-{tag}-zip'
371 name: 'xtesting-daily'
374 - 'xtesting-{tag}-daily'
386 regex: ^xtesting-[a-z0-9.]+-daily$
388 - xtesting-build-containers: &xtesting-build-containers
389 name: 'xtesting-build-containers'
390 <<: *xtesting-containers
393 build_args: '{build_args}'
397 name: xtesting-build-containers
401 if [ "{repo}" = "_" ]; then
402 image={container}:{tag}
403 elif [ "{port}" = "None" ]; then
404 image={repo}/{container}:{tag}
406 image={repo}:{port}/{container}:{tag}
409 if [ "{build_args}" != "None" ]; then
410 for i in $(echo {build_args} | tr -d '[]' |sed "s/, / /g" ); \
411 do build_args="--build-arg $i $build_args"; done
413 if [ "{ref_arg}" != "None" ]; then
414 build_args="$build_args --build-arg {ref_arg}={ref}"
417 if [ "{from}" != "None" ]; then
418 sed -i {from} Dockerfile
420 sudo docker build $build_args \
421 --pull=false --no-cache --force-rm=true \
428 url: 'https://gerrit.opnfv.org/gerrit/functest-xtesting'
429 refspec: '+refs/heads/*:refs/remotes/origin/* +refs/changes/*:refs/changes/*'
433 - xtesting-dep: &xtesting-dep
434 name: 'xtesting-containers'
438 dependency: '{dependency}'
441 name: xtesting-pull-dep-images
445 if [ "_" = "_" ]; then
446 image=alpine:{dependency}
447 elif [ "" = "None" ]; then
448 image=_/alpine:{dependency}
450 image=_:/alpine:{dependency}
452 sudo docker pull $image || true
455 name: xtesting-remove-dep-images
459 if [ "_" = "_" ]; then
460 image=alpine:{dependency}
461 elif [ "" = "None" ]; then
462 image=_/alpine:{dependency}
464 image=_:/alpine:{dependency}
466 sudo docker rmi $image || true
469 name: 'xtesting-{repo}-{tag}-dep-pull'
474 - xtesting-pull-dep-images:
478 name: 'xtesting-{repo}-{tag}-dep-pull'
481 - 'xtesting-{repo}-{tag}-dep-pull'
484 name: 'xtesting-{repo}-{tag}-dep-rmi'
489 - xtesting-remove-dep-images:
493 name: 'xtesting-{repo}-{tag}-dep-rmi'
496 - 'xtesting-{repo}-{tag}-dep-rmi'
503 sudo apt-get update && \
504 sudo DEBIAN_FRONTEND=noninteractive apt-get dist-upgrade -y
505 sudo DEBIAN_FRONTEND=noninteractive \
506 apt-get install software-properties-common gpg -y
507 sudo add-apt-repository -y ppa:deadsnakes/ppa
508 sudo apt-get update && sudo DEBIAN_FRONTEND=noninteractive \
510 python3.9 python3.9-dev python3.9-distutils \
511 python3.8 python3.8-dev python3.8-distutils \
512 python3.7 python3.7-dev python3.6 python3.6-dev \
513 python python-dev python3-pip enchant -y
514 sudo pip3 install tox tox-pip-version
519 name: 'xtesting-{tag}-tox'
524 - xtesting-patchset-created:
536 - 'xtesting-{tag}-tox'
539 name: 'xtesting-{repo}-{container}-{tag}-gate'
547 - xtesting-build-containers:
548 <<: *xtesting-build-containers
550 build_args: '{build_args}'
553 name: xtesting-opnfv-xtesting-{tag}-gate
559 - 'xtesting-{repo}-{container}-{tag}-gate'
562 name: xtesting-opnfv-xtesting-mts-{tag}-gate
564 container: xtesting-mts
568 - 'xtesting-{repo}-{container}-{tag}-gate'
571 name: xtesting-patchset-created
575 - patchset-created-event
576 - comment-added-contains-event:
577 comment-contains-value: 'recheck'
578 - comment-added-contains-event:
579 comment-contains-value: 'reverify'
581 - project-compare-type: 'ANT'
582 project-pattern: 'functest-xtesting'
584 - branch-compare-type: 'ANT'
585 branch-pattern: '**/{branch}'
588 name: 'xtesting-{tag}-review'
589 project-type: multijob
591 - xtesting-patchset-created:
596 - xtesting-build_tag:
598 # PyYAML and yamllint differ here
599 # see https://github.com/yaml/pyyaml/issues/234
600 # yamllint disable rule:indentation
604 - ^xtesting-(pi-)*{tag}-(daily|docker|review)$
605 # yamllint enable rule:indentation
608 name: remove former images
610 - name: 'xtesting-opnfv-xtesting-{tag}-rmi'
612 - name: 'xtesting-opnfv-xtesting-mts-{tag}-rmi'
615 name: remove dependency
617 - name: 'xtesting-{repo}-{tag}-dep-rmi'
620 name: pull dependency
622 - name: 'xtesting-{repo}-{tag}-dep-pull'
627 - name: 'xtesting-opnfv-xtesting-{tag}-gate'
630 name: opnfv/xtesting-mts
632 - name: 'xtesting-opnfv-xtesting-mts-{tag}-gate'
635 name: opnfv/xtesting:{tag}
637 - name: 'xtesting-opnfv-xtesting-{tag}-first-run'
639 - name: 'xtesting-opnfv-xtesting-{tag}-second-run'
641 - name: 'xtesting-opnfv-xtesting-{tag}-third-run'
643 - name: 'xtesting-opnfv-xtesting-{tag}-fourth-run'
645 - name: 'xtesting-opnfv-xtesting-{tag}-fifth-run'
647 - name: 'xtesting-opnfv-xtesting-{tag}-sixth-run'
649 - name: 'xtesting-opnfv-xtesting-{tag}-eighth-run'
652 name: opnfv/xtesting-mts:{tag}
654 - name: 'xtesting-opnfv-xtesting-mts-{tag}-seventh-run'
658 name: 'xtesting-review'
661 - 'xtesting-{tag}-review'
664 name: xtesting-review
673 regex: ^xtesting-[a-z0-9.]+-review$
685 regex: ^xtesting-[a-z0-9.]+-tox$
688 name: xtesting-push-containers
692 if [ "{repo}" = "_" ]; then
693 image={container}:{tag}
694 elif [ "{port}" = "None" ]; then
695 image={repo}/{container}:{tag}
697 image={repo}:{port}/{container}:{tag}
699 sudo docker push $image
702 name: xtesting-commit
708 name: 'xtesting-{repo}-{container}-{tag}-build'
716 - xtesting-build-containers:
717 <<: *xtesting-build-containers
719 build_args: '{build_args}'
720 - xtesting-push-containers:
721 <<: *xtesting-build-containers
725 name: xtesting-opnfv-xtesting-{tag}-build
731 - 'xtesting-{repo}-{container}-{tag}-build'
734 name: xtesting-opnfv-xtesting-mts-{tag}-build
736 container: xtesting-mts
740 - 'xtesting-{repo}-{container}-{tag}-build'
743 name: 'xtesting-{tag}-docker'
744 project-type: multijob
753 # PyYAML and yamllint differ here
754 # see https://github.com/yaml/pyyaml/issues/234
755 # yamllint disable rule:indentation
759 - ^xtesting-(pi-)*{tag}-(daily|docker|review)$
760 # yamllint enable rule:indentation
763 name: remove dependency
765 - name: 'xtesting-{repo}-{tag}-dep-rmi'
768 name: pull dependency
770 - name: 'xtesting-{repo}-{tag}-dep-pull'
775 - name: 'xtesting-opnfv-xtesting-{tag}-build'
778 name: opnfv/xtesting-mts
780 - name: 'xtesting-opnfv-xtesting-mts-{tag}-build'
787 sudo apt-get update && sudo DEBIAN_FRONTEND=noninteractive \
788 apt-get install curl -y
790 curl -sfL https://raw.githubusercontent.com/aquasecurity/trivy/main/contrib/install.sh | sudo sh -s -- -b .
791 if [ "{repo}" = "_" ]; then
792 image={container}:{tag}
793 elif [ "{port}" = "None" ]; then
794 image={repo}/{container}:{tag}
796 image={repo}:{port}/{container}:{tag}
798 ./trivy --exit-code 1 $image
801 name: 'xtesting-{repo}-{container}-{tag}-trivy'
809 <<: *xtesting-containers
812 name: 'xtesting-opnfv-xtesting-trivy'
814 container: 'xtesting'
816 - 'xtesting-{repo}-{container}-{tag}-trivy'
819 name: 'xtesting-opnfv-xtesting-mts-trivy'
821 container: 'xtesting-mts'
823 - 'xtesting-{repo}-{container}-{tag}-trivy'
829 - 'xtesting-{tag}-docker'
832 name: xtesting-docker
841 regex: ^xtesting-[a-z0-9.]+-docker$
853 regex: (?!xtesting-pi)^xtesting-[a-z-0-9.]+-trivy$