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 recipients: cedric.ollivier@orange.com
374 name: 'xtesting-daily'
377 - 'xtesting-{tag}-daily'
389 regex: ^xtesting-[a-z0-9.]+-daily$
391 - xtesting-build-containers: &xtesting-build-containers
392 name: 'xtesting-build-containers'
393 <<: *xtesting-containers
396 build_args: '{build_args}'
400 name: xtesting-build-containers
404 if [ "{repo}" = "_" ]; then
405 image={container}:{tag}
406 elif [ "{port}" = "None" ]; then
407 image={repo}/{container}:{tag}
409 image={repo}:{port}/{container}:{tag}
412 if [ "{build_args}" != "None" ]; then
413 for i in $(echo {build_args} | tr -d '[]' |sed "s/, / /g" ); \
414 do build_args="--build-arg $i $build_args"; done
416 if [ "{ref_arg}" != "None" ]; then
417 build_args="$build_args --build-arg {ref_arg}={ref}"
420 if [ "{from}" != "None" ]; then
421 sed -i {from} Dockerfile
423 sudo docker build $build_args \
424 --pull=false --no-cache --force-rm=true \
431 url: 'https://gerrit.opnfv.org/gerrit/functest-xtesting'
432 refspec: '+refs/heads/*:refs/remotes/origin/* +refs/changes/*:refs/changes/*'
436 - xtesting-dep: &xtesting-dep
437 name: 'xtesting-containers'
441 dependency: '{dependency}'
444 name: xtesting-pull-dep-images
448 if [ "_" = "_" ]; then
449 image=alpine:{dependency}
450 elif [ "" = "None" ]; then
451 image=_/alpine:{dependency}
453 image=_:/alpine:{dependency}
455 sudo docker pull $image || true
458 name: xtesting-remove-dep-images
462 if [ "_" = "_" ]; then
463 image=alpine:{dependency}
464 elif [ "" = "None" ]; then
465 image=_/alpine:{dependency}
467 image=_:/alpine:{dependency}
469 sudo docker rmi $image || true
472 name: 'xtesting-{repo}-{tag}-dep-pull'
477 - xtesting-pull-dep-images:
481 name: 'xtesting-{repo}-{tag}-dep-pull'
484 - 'xtesting-{repo}-{tag}-dep-pull'
487 name: 'xtesting-{repo}-{tag}-dep-rmi'
492 - xtesting-remove-dep-images:
496 name: 'xtesting-{repo}-{tag}-dep-rmi'
499 - 'xtesting-{repo}-{tag}-dep-rmi'
506 sudo apt-get -o DPkg::Lock::Timeout=300 update && \
507 sudo DEBIAN_FRONTEND=noninteractive apt-get \
508 -o DPkg::Lock::Timeout=300 dist-upgrade -y
509 sudo DEBIAN_FRONTEND=noninteractive \
510 apt-get -o DPkg::Lock::Timeout=300 install software-properties-common gpg -y
511 sudo add-apt-repository -y ppa:deadsnakes/ppa
512 sudo apt-get -o DPkg::Lock::Timeout=300 update && \
513 sudo DEBIAN_FRONTEND=noninteractive apt-get \
514 -o DPkg::Lock::Timeout=300 install \
515 python3.9 python3.9-dev python3.9-distutils \
516 python3.8 python3.8-dev python3.8-distutils \
517 python3.7 python3.7-dev python3.6 python3.6-dev \
518 python python-dev python3-pip enchant -y
519 sudo pip3 install tox tox-pip-version
524 name: 'xtesting-{tag}-tox'
529 - xtesting-patchset-created:
541 - 'xtesting-{tag}-tox'
544 name: 'xtesting-{repo}-{container}-{tag}-gate'
552 - xtesting-build-containers:
553 <<: *xtesting-build-containers
555 build_args: '{build_args}'
558 name: xtesting-opnfv-xtesting-{tag}-gate
564 - 'xtesting-{repo}-{container}-{tag}-gate'
567 name: xtesting-opnfv-xtesting-mts-{tag}-gate
569 container: xtesting-mts
573 - 'xtesting-{repo}-{container}-{tag}-gate'
576 name: xtesting-patchset-created
580 - patchset-created-event
581 - comment-added-contains-event:
582 comment-contains-value: 'recheck'
583 - comment-added-contains-event:
584 comment-contains-value: 'reverify'
586 - project-compare-type: 'ANT'
587 project-pattern: 'functest-xtesting'
589 - branch-compare-type: 'ANT'
590 branch-pattern: '**/{branch}'
593 name: 'xtesting-{tag}-review'
594 project-type: multijob
596 - xtesting-patchset-created:
601 - xtesting-build_tag:
603 # PyYAML and yamllint differ here
604 # see https://github.com/yaml/pyyaml/issues/234
605 # yamllint disable rule:indentation
609 - ^xtesting-(pi-)*{tag}-(daily|docker|review)$
610 # yamllint enable rule:indentation
613 name: remove former images
615 - name: 'xtesting-opnfv-xtesting-{tag}-rmi'
617 - name: 'xtesting-opnfv-xtesting-mts-{tag}-rmi'
620 name: remove dependency
622 - name: 'xtesting-{repo}-{tag}-dep-rmi'
625 name: pull dependency
627 - name: 'xtesting-{repo}-{tag}-dep-pull'
632 - name: 'xtesting-opnfv-xtesting-{tag}-gate'
635 name: opnfv/xtesting-mts
637 - name: 'xtesting-opnfv-xtesting-mts-{tag}-gate'
640 name: opnfv/xtesting:{tag}
642 - name: 'xtesting-opnfv-xtesting-{tag}-first-run'
644 - name: 'xtesting-opnfv-xtesting-{tag}-second-run'
646 - name: 'xtesting-opnfv-xtesting-{tag}-third-run'
648 - name: 'xtesting-opnfv-xtesting-{tag}-fourth-run'
650 - name: 'xtesting-opnfv-xtesting-{tag}-fifth-run'
652 - name: 'xtesting-opnfv-xtesting-{tag}-sixth-run'
654 - name: 'xtesting-opnfv-xtesting-{tag}-eighth-run'
657 name: opnfv/xtesting-mts:{tag}
659 - name: 'xtesting-opnfv-xtesting-mts-{tag}-seventh-run'
663 recipients: cedric.ollivier@orange.com
666 name: 'xtesting-review'
669 - 'xtesting-{tag}-review'
672 name: xtesting-review
681 regex: ^xtesting-[a-z0-9.]+-review$
693 regex: ^xtesting-[a-z0-9.]+-tox$
696 name: xtesting-push-containers
700 if [ "{repo}" = "_" ]; then
701 image={container}:{tag}
702 elif [ "{port}" = "None" ]; then
703 image={repo}/{container}:{tag}
705 image={repo}:{port}/{container}:{tag}
707 sudo docker push $image
710 name: xtesting-commit
716 name: 'xtesting-{repo}-{container}-{tag}-build'
724 - xtesting-build-containers:
725 <<: *xtesting-build-containers
727 build_args: '{build_args}'
728 - xtesting-push-containers:
729 <<: *xtesting-build-containers
733 name: xtesting-opnfv-xtesting-{tag}-build
739 - 'xtesting-{repo}-{container}-{tag}-build'
742 name: xtesting-opnfv-xtesting-mts-{tag}-build
744 container: xtesting-mts
748 - 'xtesting-{repo}-{container}-{tag}-build'
751 name: 'xtesting-{tag}-docker'
752 project-type: multijob
761 # PyYAML and yamllint differ here
762 # see https://github.com/yaml/pyyaml/issues/234
763 # yamllint disable rule:indentation
767 - ^xtesting-(pi-)*{tag}-(daily|docker|review)$
768 # yamllint enable rule:indentation
771 name: remove dependency
773 - name: 'xtesting-{repo}-{tag}-dep-rmi'
776 name: pull dependency
778 - name: 'xtesting-{repo}-{tag}-dep-pull'
783 - name: 'xtesting-opnfv-xtesting-{tag}-build'
786 name: opnfv/xtesting-mts
788 - name: 'xtesting-opnfv-xtesting-mts-{tag}-build'
792 recipients: cedric.ollivier@orange.com
798 sudo apt-get -o DPkg::Lock::Timeout=300 update && \
799 sudo DEBIAN_FRONTEND=noninteractive apt-get \
800 -o DPkg::Lock::Timeout=300 install curl -y
802 curl -sfL https://raw.githubusercontent.com/aquasecurity/trivy/main/contrib/install.sh | sudo sh -s -- -b .
803 if [ "{repo}" = "_" ]; then
804 image={container}:{tag}
805 elif [ "{port}" = "None" ]; then
806 image={repo}/{container}:{tag}
808 image={repo}:{port}/{container}:{tag}
810 ./trivy --exit-code 1 $image
813 name: 'xtesting-{repo}-{container}-{tag}-trivy'
821 <<: *xtesting-containers
824 recipients: cedric.ollivier@orange.com
827 name: 'xtesting-opnfv-xtesting-trivy'
829 container: 'xtesting'
831 - 'xtesting-{repo}-{container}-{tag}-trivy'
834 name: 'xtesting-opnfv-xtesting-mts-trivy'
836 container: 'xtesting-mts'
838 - 'xtesting-{repo}-{container}-{tag}-trivy'
844 - 'xtesting-{tag}-docker'
847 name: xtesting-docker
856 regex: ^xtesting-[a-z0-9.]+-docker$
868 regex: (?!xtesting-pi)^xtesting-[a-z-0-9.]+-trivy$