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'
374 recipients: cedric.ollivier@orange.com
377 name: 'xtesting-daily'
380 - 'xtesting-{tag}-daily'
392 regex: ^xtesting-[a-z0-9.]+-daily$
394 - xtesting-build-containers: &xtesting-build-containers
395 name: 'xtesting-build-containers'
396 <<: *xtesting-containers
399 build_args: '{build_args}'
403 name: xtesting-build-containers
407 if [ "{repo}" = "_" ]; then
408 image={container}:{tag}
409 elif [ "{port}" = "None" ]; then
410 image={repo}/{container}:{tag}
412 image={repo}:{port}/{container}:{tag}
415 if [ "{build_args}" != "None" ]; then
416 for i in $(echo {build_args} | tr -d '[]' |sed "s/, / /g" ); \
417 do build_args="--build-arg $i $build_args"; done
419 if [ "{ref_arg}" != "None" ]; then
420 build_args="$build_args --build-arg {ref_arg}={ref}"
423 if [ "{from}" != "None" ]; then
424 sed -i {from} Dockerfile
426 sudo docker build $build_args \
427 --pull=false --no-cache --force-rm=true \
434 url: 'https://gerrit.opnfv.org/gerrit/functest-xtesting'
435 refspec: '+refs/heads/*:refs/remotes/origin/* +refs/changes/*:refs/changes/*'
439 - xtesting-dep: &xtesting-dep
440 name: 'xtesting-containers'
444 dependency: '{dependency}'
447 name: xtesting-pull-dep-images
451 if [ "_" = "_" ]; then
452 image=alpine:{dependency}
453 elif [ "" = "None" ]; then
454 image=_/alpine:{dependency}
456 image=_:/alpine:{dependency}
458 sudo docker pull $image || true
461 name: xtesting-remove-dep-images
465 if [ "_" = "_" ]; then
466 image=alpine:{dependency}
467 elif [ "" = "None" ]; then
468 image=_/alpine:{dependency}
470 image=_:/alpine:{dependency}
472 sudo docker rmi $image || true
475 name: 'xtesting-{repo}-{tag}-dep-pull'
480 - xtesting-pull-dep-images:
484 name: 'xtesting-{repo}-{tag}-dep-pull'
487 - 'xtesting-{repo}-{tag}-dep-pull'
490 name: 'xtesting-{repo}-{tag}-dep-rmi'
495 - xtesting-remove-dep-images:
499 name: 'xtesting-{repo}-{tag}-dep-rmi'
502 - 'xtesting-{repo}-{tag}-dep-rmi'
509 sudo apt-get -o DPkg::Lock::Timeout=300 update && \
510 sudo DEBIAN_FRONTEND=noninteractive apt-get \
511 -o DPkg::Lock::Timeout=300 dist-upgrade -y
512 sudo DEBIAN_FRONTEND=noninteractive \
513 apt-get -o DPkg::Lock::Timeout=300 install software-properties-common gpg -y
514 sudo add-apt-repository -y ppa:deadsnakes/ppa
515 sudo apt-get -o DPkg::Lock::Timeout=300 update && \
516 sudo DEBIAN_FRONTEND=noninteractive apt-get \
517 -o DPkg::Lock::Timeout=300 install \
518 python3.9 python3.9-dev python3.9-distutils \
519 python3.8 python3.8-dev python3.8-distutils \
520 python3.7 python3.7-dev python3.6 python3.6-dev \
521 python python-dev python3-pip enchant -y
522 sudo pip3 install tox tox-pip-version
527 name: 'xtesting-{tag}-tox'
532 - xtesting-patchset-created:
544 - 'xtesting-{tag}-tox'
547 name: 'xtesting-{repo}-{container}-{tag}-gate'
555 - xtesting-build-containers:
556 <<: *xtesting-build-containers
558 build_args: '{build_args}'
561 name: xtesting-opnfv-xtesting-{tag}-gate
567 - 'xtesting-{repo}-{container}-{tag}-gate'
570 name: xtesting-opnfv-xtesting-mts-{tag}-gate
572 container: xtesting-mts
576 - 'xtesting-{repo}-{container}-{tag}-gate'
579 name: xtesting-patchset-created
583 - patchset-created-event
584 - comment-added-contains-event:
585 comment-contains-value: 'recheck'
586 - comment-added-contains-event:
587 comment-contains-value: 'reverify'
589 - project-compare-type: 'ANT'
590 project-pattern: 'functest-xtesting'
592 - branch-compare-type: 'ANT'
593 branch-pattern: '**/{branch}'
596 name: 'xtesting-{tag}-review'
597 project-type: multijob
599 - xtesting-patchset-created:
604 - xtesting-build_tag:
606 # PyYAML and yamllint differ here
607 # see https://github.com/yaml/pyyaml/issues/234
608 # yamllint disable rule:indentation
612 - ^xtesting-(pi-)*{tag}-(daily|docker|review)$
613 # yamllint enable rule:indentation
616 name: remove former images
618 - name: 'xtesting-opnfv-xtesting-{tag}-rmi'
620 - name: 'xtesting-opnfv-xtesting-mts-{tag}-rmi'
623 name: remove dependency
625 - name: 'xtesting-{repo}-{tag}-dep-rmi'
628 name: pull dependency
630 - name: 'xtesting-{repo}-{tag}-dep-pull'
635 - name: 'xtesting-opnfv-xtesting-{tag}-gate'
638 name: opnfv/xtesting-mts
640 - name: 'xtesting-opnfv-xtesting-mts-{tag}-gate'
643 name: opnfv/xtesting:{tag}
645 - name: 'xtesting-opnfv-xtesting-{tag}-first-run'
647 - name: 'xtesting-opnfv-xtesting-{tag}-second-run'
649 - name: 'xtesting-opnfv-xtesting-{tag}-third-run'
651 - name: 'xtesting-opnfv-xtesting-{tag}-fourth-run'
653 - name: 'xtesting-opnfv-xtesting-{tag}-fifth-run'
655 - name: 'xtesting-opnfv-xtesting-{tag}-sixth-run'
657 - name: 'xtesting-opnfv-xtesting-{tag}-eighth-run'
660 name: opnfv/xtesting-mts:{tag}
662 - name: 'xtesting-opnfv-xtesting-mts-{tag}-seventh-run'
669 recipients: cedric.ollivier@orange.com
672 name: 'xtesting-review'
675 - 'xtesting-{tag}-review'
678 name: xtesting-review
687 regex: ^xtesting-[a-z0-9.]+-review$
699 regex: ^xtesting-[a-z0-9.]+-tox$
702 name: xtesting-push-containers
706 if [ "{repo}" = "_" ]; then
707 image={container}:{tag}
708 elif [ "{port}" = "None" ]; then
709 image={repo}/{container}:{tag}
711 image={repo}:{port}/{container}:{tag}
713 sudo docker push $image
716 name: xtesting-commit
722 name: 'xtesting-{repo}-{container}-{tag}-build'
730 - xtesting-build-containers:
731 <<: *xtesting-build-containers
733 build_args: '{build_args}'
734 - xtesting-push-containers:
735 <<: *xtesting-build-containers
739 name: xtesting-opnfv-xtesting-{tag}-build
745 - 'xtesting-{repo}-{container}-{tag}-build'
748 name: xtesting-opnfv-xtesting-mts-{tag}-build
750 container: xtesting-mts
754 - 'xtesting-{repo}-{container}-{tag}-build'
757 name: 'xtesting-{tag}-docker'
758 project-type: multijob
767 # PyYAML and yamllint differ here
768 # see https://github.com/yaml/pyyaml/issues/234
769 # yamllint disable rule:indentation
773 - ^xtesting-(pi-)*{tag}-(daily|docker|review)$
774 # yamllint enable rule:indentation
777 name: remove dependency
779 - name: 'xtesting-{repo}-{tag}-dep-rmi'
782 name: pull dependency
784 - name: 'xtesting-{repo}-{tag}-dep-pull'
789 - name: 'xtesting-opnfv-xtesting-{tag}-build'
792 name: opnfv/xtesting-mts
794 - name: 'xtesting-opnfv-xtesting-mts-{tag}-build'
801 recipients: cedric.ollivier@orange.com
807 sudo apt-get -o DPkg::Lock::Timeout=300 update && \
808 sudo DEBIAN_FRONTEND=noninteractive apt-get \
809 -o DPkg::Lock::Timeout=300 install curl -y
811 curl -sfL https://raw.githubusercontent.com/aquasecurity/trivy/main/contrib/install.sh | sudo sh -s -- -b .
812 if [ "{repo}" = "_" ]; then
813 image={container}:{tag}
814 elif [ "{port}" = "None" ]; then
815 image={repo}/{container}:{tag}
817 image={repo}:{port}/{container}:{tag}
819 ./trivy --exit-code 1 $image
822 name: 'xtesting-{repo}-{container}-{tag}-trivy'
830 <<: *xtesting-containers
836 recipients: cedric.ollivier@orange.com
839 name: 'xtesting-opnfv-xtesting-trivy'
841 container: 'xtesting'
843 - 'xtesting-{repo}-{container}-{tag}-trivy'
846 name: 'xtesting-opnfv-xtesting-mts-trivy'
848 container: 'xtesting-mts'
850 - 'xtesting-{repo}-{container}-{tag}-trivy'
856 - 'xtesting-{tag}-docker'
859 name: xtesting-docker
868 regex: ^xtesting-[a-z0-9.]+-docker$
880 regex: (?!xtesting-pi)^xtesting-[a-z-0-9.]+-trivy$