2 - xtesting-containers: &xtesting-containers
3 name: 'xtesting-containers'
6 container: '{container}'
9 - xtesting-params: &xtesting-params
10 name: 'xtesting-params'
41 branch: stable/wallaby
45 - xtesting-jobs: &xtesting-jobs
47 current-parameters: true
57 name: xtesting-build_tag
62 - xtesting-run-containers: &xtesting-run-containers
63 name: 'xtesting-run-containers'
64 <<: *xtesting-containers
66 privileged: '{privileged}'
72 published_ports: '{published_ports}'
75 name: xtesting-pull-containers
79 if [ "{repo}" = "_" ]; then
80 image={container}:{tag}
81 elif [ "{port}" = "None" ]; then
82 image={repo}/{container}:{tag}
84 image={repo}:{port}/{container}:{tag}
86 sudo docker pull $image
89 name: xtesting-run-containers
94 if [ "{volumes}" != "None" ]; then
95 for i in $(echo {volumes} | tr -d '[]' |sed "s/, / /g" ); \
96 do volumes="-v $i $volumes"; done
99 if [ "{env}" != "None" ]; then
100 for i in $(eval echo {env} | tr -d '[]' |sed "s/, / /g" ); \
101 do env="-e $i $env"; done
104 if [ "{published_ports}" != "None" ]; then
105 for i in $(echo {published_ports} | tr -d '[]' |sed "s/, / /g" ); \
106 do published_ports="-p $i $published_ports"; 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} \
124 -e S3_ENDPOINT_URL=https://storage.googleapis.com \
125 -e S3_DST_URL=s3://artifacts.opnfv.org/xtesting/$BUILD_TAG/$JOB_NAME-$BUILD_ID \
126 -e HTTP_DST_URL=http://artifacts.opnfv.org/xtesting/$BUILD_TAG/$JOB_NAME-$BUILD_ID \
127 -v /home/opnfv/xtesting/.boto:/etc/boto.cfg \
128 -e TEST_DB_URL=http://testresults.opnfv.org/test/api/v1/results \
129 -e TEST_DB_EXT_URL=http://testresults.opnfv.org/test/api/v1/results \
131 -e BUILD_TAG=$BUILD_TAG \
132 -v $WORKSPACE/../$JOB_NAME/results:/var/lib/xtesting/results \
133 $image run_tests -t {test} -p -r
136 name: xtesting-remove-images
140 if [ "{repo}" = "_" ]; then
141 image={container}:{tag}
142 elif [ "{port}" = "None" ]; then
143 image={repo}/{container}:{tag}
145 image={repo}:{port}/{container}:{tag}
147 sudo docker rmi $image || true
150 name: 'xtesting-{repo}-{container}-{tag}-pull'
155 - xtesting-pull-containers:
156 <<: *xtesting-containers
159 name: 'xtesting-opnfv-xtesting-pull'
161 container: 'xtesting'
163 - 'xtesting-{repo}-{container}-{tag}-pull'
166 name: 'xtesting-{repo}-{container}-{tag}-rmi'
171 - xtesting-remove-images:
172 <<: *xtesting-containers
175 name: 'xtesting-opnfv-xtesting-rmi'
177 container: 'xtesting'
179 - 'xtesting-{repo}-{container}-{tag}-rmi'
182 name: 'xtesting-opnfv-xtesting-{tag}-{test}-run'
186 - xtesting-build_tag:
189 - xtesting-run-containers:
190 <<: *xtesting-run-containers
193 name: 'xtesting-opnfv-xtesting'
198 container: 'xtesting'
218 - 'xtesting-opnfv-xtesting-{tag}-{test}-run'
226 if [ "{volumes}" != "None" ]; then
227 for i in $(echo {volumes} | tr -d '[]' |sed "s/, / /g" ); \
228 do volumes="-v $i $volumes"; done
231 if [ "{env}" != "None" ]; then
232 for i in $(eval echo {env} | tr -d '[]' |sed "s/, / /g" ); \
233 do env="-e $i $env"; done
236 if [ "{published_ports}" != "None" ]; then
237 for i in $(echo {published_ports} | tr -d '[]' |sed "s/, / /g" ); \
238 do published_ports="-p $i $published_ports"; done
240 [ ! -z "$WORKSPACE" ] && sudo rm -rf $WORKSPACE/results || true
241 if [ "{repo}" = "_" ]; then
242 image={container}:{tag}
243 elif [ "{port}" = "None" ]; then
244 image={repo}/{container}:{tag}
246 image={repo}:{port}/{container}:{tag}
248 sudo mkdir -p $WORKSPACE/results
249 sudo chown {uid}:{gid} $WORKSPACE/results
250 sudo docker run --rm \
254 -e S3_ENDPOINT_URL=https://storage.googleapis.com \
255 -e S3_DST_URL=s3://artifacts.opnfv.org/xtesting \
256 -e HTTP_DST_URL=http://artifacts.opnfv.org/xtesting \
257 -v /home/opnfv/xtesting/.boto:/etc/boto.cfg \
258 -e TEST_DB_URL=http://testresults.opnfv.org/test/api/v1/results \
259 -e TEST_DB_EXT_URL=http://testresults.opnfv.org/test/api/v1/results \
260 -e BUILD_TAG=$BUILD_TAG \
261 -v $WORKSPACE/../$JOB_NAME/results:/var/lib/xtesting/results \
265 name: 'xtesting-{tag}-zip'
269 - xtesting-build_tag:
273 <<: *xtesting-containers
278 published_ports: '{published_ports}'
281 name: 'xtesting-{tag}-zip'
286 container: 'xtesting'
290 - 'xtesting-{tag}-zip'
293 name: 'xtesting-{tag}-daily'
294 project-type: multijob
300 - xtesting-build_tag:
302 # PyYAML and yamllint differ here
303 # see https://github.com/yaml/pyyaml/issues/234
304 # yamllint disable rule:indentation
308 - ^xtesting-(pi-)*{tag}-(daily|docker|review)$
309 # yamllint enable rule:indentation
312 name: remove former images
314 - name: 'xtesting-opnfv-xtesting-{tag}-rmi'
317 name: pull containers
319 - name: 'xtesting-opnfv-xtesting-{tag}-pull'
322 name: opnfv/xtesting:{tag}
324 - name: 'xtesting-opnfv-xtesting-{tag}-first-run'
326 - name: 'xtesting-opnfv-xtesting-{tag}-second-run'
328 - name: 'xtesting-opnfv-xtesting-{tag}-third-run'
330 - name: 'xtesting-opnfv-xtesting-{tag}-fourth-run'
332 - name: 'xtesting-opnfv-xtesting-{tag}-fifth-run'
334 - name: 'xtesting-opnfv-xtesting-{tag}-sixth-run'
336 - name: 'xtesting-opnfv-xtesting-{tag}-eighth-run'
338 - name: 'xtesting-opnfv-xtesting-{tag}-nineth-run'
341 name: dump all campaign data
343 - name: 'xtesting-{tag}-zip'
350 recipients: cedric.ollivier@orange.com
353 name: 'xtesting-daily'
356 - 'xtesting-{tag}-daily'
368 regex: ^xtesting-[a-z0-9.]+-daily$
370 - xtesting-build-containers: &xtesting-build-containers
371 name: 'xtesting-build-containers'
372 <<: *xtesting-containers
375 build_args: '{build_args}'
379 name: xtesting-build-containers
383 if [ "{repo}" = "_" ]; then
384 image={container}:{tag}
385 elif [ "{port}" = "None" ]; then
386 image={repo}/{container}:{tag}
388 image={repo}:{port}/{container}:{tag}
391 if [ "{build_args}" != "None" ]; then
392 for i in $(echo {build_args} | tr -d '[]' |sed "s/, / /g" ); \
393 do build_args="--build-arg $i $build_args"; done
395 if [ "{ref_arg}" != "None" ]; then
396 build_args="$build_args --build-arg {ref_arg}={ref}"
399 if [ "{from}" != "None" ]; then
400 sed -i {from} Dockerfile
402 sudo docker build $build_args \
403 --pull=false --no-cache --force-rm=true \
410 url: 'https://gerrit.opnfv.org/gerrit/functest-xtesting'
411 refspec: '+refs/heads/*:refs/remotes/origin/* +refs/changes/*:refs/changes/*'
415 - xtesting-dep: &xtesting-dep
416 name: 'xtesting-containers'
420 dependency: '{dependency}'
423 name: xtesting-pull-dep-images
427 if [ "_" = "_" ]; then
428 image=alpine:{dependency}
429 elif [ "" = "None" ]; then
430 image=_/alpine:{dependency}
432 image=_:/alpine:{dependency}
434 sudo docker pull $image || true
437 name: xtesting-remove-dep-images
441 if [ "_" = "_" ]; then
442 image=alpine:{dependency}
443 elif [ "" = "None" ]; then
444 image=_/alpine:{dependency}
446 image=_:/alpine:{dependency}
448 sudo docker rmi $image || true
451 name: 'xtesting-{repo}-{tag}-dep-pull'
456 - xtesting-pull-dep-images:
460 name: 'xtesting-{repo}-{tag}-dep-pull'
463 - 'xtesting-{repo}-{tag}-dep-pull'
466 name: 'xtesting-{repo}-{tag}-dep-rmi'
471 - xtesting-remove-dep-images:
475 name: 'xtesting-{repo}-{tag}-dep-rmi'
478 - 'xtesting-{repo}-{tag}-dep-rmi'
485 sudo apt-get -o DPkg::Lock::Timeout=300 update && \
486 sudo DEBIAN_FRONTEND=noninteractive apt-get \
487 -o DPkg::Lock::Timeout=300 dist-upgrade -y
488 sudo DEBIAN_FRONTEND=noninteractive \
489 apt-get -o DPkg::Lock::Timeout=300 install software-properties-common gpg -y
490 sudo add-apt-repository -y ppa:deadsnakes/ppa
491 sudo apt-get -o DPkg::Lock::Timeout=300 update && \
492 sudo DEBIAN_FRONTEND=noninteractive apt-get \
493 -o DPkg::Lock::Timeout=300 install \
494 libxml2-dev libxslt-dev libffi-dev libjpeg-dev \
495 python3.10 python3.10-dev python3.10-distutils \
496 python3.9 python3.9-dev python3.9-distutils \
497 python3.8 python3.8-dev python3.8-distutils \
498 python3-pip enchant-2 -y
499 sudo pip3 install tox tox-pip-version
504 name: 'xtesting-{tag}-tox'
509 - xtesting-patchset-created:
521 - 'xtesting-{tag}-tox'
524 name: 'xtesting-{repo}-{container}-{tag}-gate'
532 - xtesting-build-containers:
533 <<: *xtesting-build-containers
535 build_args: '{build_args}'
538 name: xtesting-opnfv-xtesting-{tag}-gate
544 - 'xtesting-{repo}-{container}-{tag}-gate'
547 name: xtesting-patchset-created
551 - patchset-created-event
552 - comment-added-contains-event:
553 comment-contains-value: 'recheck'
554 - comment-added-contains-event:
555 comment-contains-value: 'reverify'
557 - project-compare-type: 'ANT'
558 project-pattern: 'functest-xtesting'
560 - branch-compare-type: 'ANT'
561 branch-pattern: '**/{branch}'
564 name: 'xtesting-{tag}-review'
565 project-type: multijob
567 - xtesting-patchset-created:
572 - xtesting-build_tag:
574 # PyYAML and yamllint differ here
575 # see https://github.com/yaml/pyyaml/issues/234
576 # yamllint disable rule:indentation
580 - ^xtesting-(pi-)*{tag}-(daily|docker|review)$
581 # yamllint enable rule:indentation
584 name: remove former images
586 - name: 'xtesting-opnfv-xtesting-{tag}-rmi'
589 name: remove dependency
591 - name: 'xtesting-{repo}-{tag}-dep-rmi'
594 name: pull dependency
596 - name: 'xtesting-{repo}-{tag}-dep-pull'
601 - name: 'xtesting-opnfv-xtesting-{tag}-gate'
604 name: opnfv/xtesting:{tag}
606 - name: 'xtesting-opnfv-xtesting-{tag}-first-run'
608 - name: 'xtesting-opnfv-xtesting-{tag}-second-run'
610 - name: 'xtesting-opnfv-xtesting-{tag}-third-run'
612 - name: 'xtesting-opnfv-xtesting-{tag}-fourth-run'
614 - name: 'xtesting-opnfv-xtesting-{tag}-fifth-run'
616 - name: 'xtesting-opnfv-xtesting-{tag}-sixth-run'
618 - name: 'xtesting-opnfv-xtesting-{tag}-eighth-run'
620 - name: 'xtesting-opnfv-xtesting-{tag}-nineth-run'
627 recipients: cedric.ollivier@orange.com
630 name: 'xtesting-review'
633 - 'xtesting-{tag}-review'
636 name: xtesting-review
645 regex: ^xtesting-[a-z0-9.]+-review$
657 regex: ^xtesting-[a-z0-9.]+-tox$
660 name: xtesting-push-containers
664 if [ "{repo}" = "_" ]; then
665 image={container}:{tag}
666 elif [ "{port}" = "None" ]; then
667 image={repo}/{container}:{tag}
669 image={repo}:{port}/{container}:{tag}
671 sudo docker push $image
674 name: xtesting-commit
680 name: 'xtesting-{repo}-{container}-{tag}-build'
688 - xtesting-build-containers:
689 <<: *xtesting-build-containers
691 build_args: '{build_args}'
692 - xtesting-push-containers:
693 <<: *xtesting-build-containers
697 name: xtesting-opnfv-xtesting-{tag}-build
703 - 'xtesting-{repo}-{container}-{tag}-build'
706 name: 'xtesting-{tag}-docker'
707 project-type: multijob
716 # PyYAML and yamllint differ here
717 # see https://github.com/yaml/pyyaml/issues/234
718 # yamllint disable rule:indentation
722 - ^xtesting-(pi-)*{tag}-(daily|docker|review)$
723 # yamllint enable rule:indentation
726 name: remove dependency
728 - name: 'xtesting-{repo}-{tag}-dep-rmi'
731 name: pull dependency
733 - name: 'xtesting-{repo}-{tag}-dep-pull'
738 - name: 'xtesting-opnfv-xtesting-{tag}-build'
745 recipients: cedric.ollivier@orange.com
751 sudo apt-get -o DPkg::Lock::Timeout=300 update && \
752 sudo DEBIAN_FRONTEND=noninteractive apt-get \
753 -o DPkg::Lock::Timeout=300 install curl -y
755 curl -sfL https://raw.githubusercontent.com/aquasecurity/trivy/main/contrib/install.sh | sudo sh -s -- -b .
756 if [ "{repo}" = "_" ]; then
757 image={container}:{tag}
758 elif [ "{port}" = "None" ]; then
759 image={repo}/{container}:{tag}
761 image={repo}:{port}/{container}:{tag}
763 ./trivy image --exit-code 1 $image
766 name: 'xtesting-{repo}-{container}-{tag}-trivy'
774 <<: *xtesting-containers
780 recipients: cedric.ollivier@orange.com
783 name: 'xtesting-opnfv-xtesting-trivy'
785 container: 'xtesting'
787 - 'xtesting-{repo}-{container}-{tag}-trivy'
793 sudo apt-get -o DPkg::Lock::Timeout=300 update && \
794 sudo DEBIAN_FRONTEND=noninteractive apt-get \
795 -o DPkg::Lock::Timeout=300 install curl -y
797 curl -sSfL https://raw.githubusercontent.com/anchore/grype/main/install.sh | sudo sh -s -- -b .
798 if [ "{repo}" = "_" ]; then
799 image={container}:{tag}
800 elif [ "{port}" = "None" ]; then
801 image={repo}/{container}:{tag}
803 image={repo}:{port}/{container}:{tag}
808 name: 'xtesting-{repo}-{container}-{tag}-grype'
816 <<: *xtesting-containers
822 recipients: cedric.ollivier@orange.com
825 name: 'xtesting-opnfv-xtesting-grype'
827 container: 'xtesting'
829 - 'xtesting-{repo}-{container}-{tag}-grype'
835 - 'xtesting-{tag}-docker'
838 name: xtesting-docker
847 regex: ^xtesting-[a-z0-9.]+-docker$
859 regex: (?!xtesting-pi)^xtesting-[a-z-0-9.]+-trivy$
871 regex: (?!xtesting-pi)^xtesting-[a-z-0-9.]+-grype$