2 - xtesting-containers: &xtesting-containers
3 name: 'xtesting-containers'
6 container: '{container}'
9 - xtesting-params: &xtesting-params
10 name: 'xtesting-params'
23 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 name: xtesting-pull-containers
76 if [ "{repo}" = "_" ]; then
77 image={container}:{tag}
78 elif [ "{port}" = "None" ]; then
79 image={repo}/{container}:{tag}
81 image={repo}:{port}/{container}:{tag}
86 name: xtesting-run-containers
91 if [ "{volumes}" != "None" ]; then
92 for i in $(echo {volumes} | tr -d '[] ' |sed "s/,/ /g" ); do volumes="-v $i $volumes"; done
95 if [ "{env}" != "None" ]; then
96 for i in $(eval echo {env} | tr -d '[] ' |sed "s/,/ /g" ); do env="-e $i $env"; done
98 [ ! -z "$WORKSPACE" ] && rm -rf $WORKSPACE/results || true
99 if [ "{repo}" = "_" ]; then
100 image={container}:{tag}
101 elif [ "{port}" = "None" ]; then
102 image={repo}/{container}:{tag}
104 image={repo}:{port}/{container}:{tag}
107 --privileged={privileged} \
108 --network={network} \
111 -e S3_ENDPOINT_URL=https://storage.googleapis.com \
112 -e S3_DST_URL=s3://artifacts.opnfv.org/xtesting/$BUILD_TAG/$JOB_NAME-$BUILD_ID \
113 -e HTTP_DST_URL=http://artifacts.opnfv.org/xtesting/$BUILD_TAG/$JOB_NAME-$BUILD_ID \
114 -v /home/opnfv/xtesting/.boto:/root/.boto \
115 -e TEST_DB_URL=http://testresults.opnfv.org/test/api/v1/results \
116 -e TEST_DB_EXT_URL=http://testresults.opnfv.org/test/api/v1/results \
117 -e NODE_NAME=$slave \
118 -e BUILD_TAG=$BUILD_TAG \
119 -v $WORKSPACE/../$JOB_NAME/results:/var/lib/xtesting/results \
120 $image run_tests -t {test} -p -r
123 name: xtesting-remove-images
127 if [ "{repo}" = "_" ]; then
128 image={container}:{tag}
129 elif [ "{port}" = "None" ]; then
130 image={repo}/{container}:{tag}
132 image={repo}:{port}/{container}:{tag}
134 docker rmi $image || true
137 name: 'xtesting-{repo}-{container}-{tag}-pull'
142 - xtesting-pull-containers:
143 <<: *xtesting-containers
146 name: 'xtesting-opnfv-xtesting-pull'
148 container: 'xtesting'
150 - 'xtesting-{repo}-{container}-{tag}-pull'
153 name: 'xtesting-opnfv-xtesting-mts-pull'
155 container: 'xtesting-mts'
157 - 'xtesting-{repo}-{container}-{tag}-pull'
160 name: 'xtesting-{repo}-{container}-{tag}-rmi'
165 - xtesting-remove-images:
166 <<: *xtesting-containers
169 name: 'xtesting-opnfv-xtesting-rmi'
171 container: 'xtesting'
173 - 'xtesting-{repo}-{container}-{tag}-rmi'
176 name: 'xtesting-opnfv-xtesting-mts-rmi'
178 container: 'xtesting-mts'
180 - 'xtesting-{repo}-{container}-{tag}-rmi'
183 name: 'xtesting-opnfv-xtesting-{tag}-{test}-run'
187 - xtesting-build_tag:
190 - xtesting-run-containers:
191 <<: *xtesting-run-containers
194 name: 'xtesting-opnfv-xtesting'
198 container: 'xtesting'
217 - 'xtesting-opnfv-xtesting-{tag}-{test}-run'
220 name: 'xtesting-opnfv-xtesting-mts-{tag}-{test}-run'
224 - xtesting-build_tag:
227 - xtesting-run-containers:
228 <<: *xtesting-run-containers
231 name: 'xtesting-opnfv-xtesting-mts'
235 container: 'xtesting-mts'
241 - 'xtesting-opnfv-xtesting-mts-{tag}-{test}-run'
249 if [ "{volumes}" != "None" ]; then
250 for i in $(echo {volumes} | tr -d '[] ' |sed "s/,/ /g" ); do volumes="-v $i $volumes"; done
253 if [ "{env}" != "None" ]; then
254 for i in $(eval echo {env} | tr -d '[] ' |sed "s/,/ /g" ); do env="-e $i $env"; done
256 [ ! -z "$WORKSPACE" ] && rm -rf $WORKSPACE/results || true
257 if [ "{repo}" = "_" ]; then
258 image={container}:{tag}
259 elif [ "{port}" = "None" ]; then
260 image={repo}/{container}:{tag}
262 image={repo}:{port}/{container}:{tag}
267 -e S3_ENDPOINT_URL=https://storage.googleapis.com \
268 -e S3_DST_URL=s3://artifacts.opnfv.org/xtesting \
269 -e HTTP_DST_URL=http://artifacts.opnfv.org/xtesting \
270 -v /home/opnfv/xtesting/.boto:/root/.boto \
271 -e TEST_DB_URL=http://testresults.opnfv.org/test/api/v1/results \
272 -e TEST_DB_EXT_URL=http://testresults.opnfv.org/test/api/v1/results \
273 -e BUILD_TAG=$BUILD_TAG \
274 -v $WORKSPACE/../$JOB_NAME/results:/var/lib/xtesting/results \
278 name: 'xtesting-{tag}-zip'
282 - xtesting-build_tag:
286 <<: *xtesting-containers
291 name: 'xtesting-{tag}-zip'
295 container: 'xtesting'
297 - 'xtesting-{tag}-zip'
300 name: 'xtesting-{tag}-daily'
301 project-type: multijob
307 - xtesting-build_tag:
309 # PyYAML and yamllint differ here
310 # see https://github.com/yaml/pyyaml/issues/234
311 # yamllint disable rule:indentation
315 - ^xtesting-(pi-)*{tag}-(daily|docker|review)$
316 # yamllint enable rule:indentation
319 name: remove former images
321 - name: 'xtesting-opnfv-xtesting-{tag}-rmi'
323 - name: 'xtesting-opnfv-xtesting-mts-{tag}-rmi'
326 name: pull containers
328 - name: 'xtesting-opnfv-xtesting-{tag}-pull'
330 - name: 'xtesting-opnfv-xtesting-mts-{tag}-pull'
333 name: opnfv/xtesting:{tag}
335 - name: 'xtesting-opnfv-xtesting-{tag}-first-run'
337 - name: 'xtesting-opnfv-xtesting-{tag}-second-run'
339 - name: 'xtesting-opnfv-xtesting-{tag}-third-run'
341 - name: 'xtesting-opnfv-xtesting-{tag}-fourth-run'
343 - name: 'xtesting-opnfv-xtesting-{tag}-fifth-run'
345 - name: 'xtesting-opnfv-xtesting-{tag}-sixth-run'
347 - name: 'xtesting-opnfv-xtesting-{tag}-eighth-run'
350 name: opnfv/xtesting-mts:{tag}
352 - name: 'xtesting-opnfv-xtesting-mts-{tag}-seventh-run'
355 name: dump all campaign data
357 - name: 'xtesting-{tag}-zip'
361 name: 'xtesting-daily'
364 - 'xtesting-{tag}-daily'
376 regex: ^xtesting-[a-z0-9.]+-daily$
378 - xtesting-build-containers: &xtesting-build-containers
379 name: 'xtesting-build-containers'
380 <<: *xtesting-containers
383 buildargs: '{buildargs}'
387 name: xtesting-build-containers
391 if [ "{repo}" = "_" ]; then
392 image={container}:{tag}
393 elif [ "{port}" = "None" ]; then
394 image={repo}/{container}:{tag}
396 image={repo}:{port}/{container}:{tag}
399 if [ "{buildargs}" != "None" ]; then
400 build_args="{buildargs}"
402 if [ "{ref_arg}" != "None" ]; then
403 build_args="$build_args --build-arg {ref_arg}={ref}"
406 if [ "{from}" != "None" ]; then
407 sed -i {from} Dockerfile
409 docker build $build_args \
410 --pull=false --no-cache --force-rm=true \
417 url: 'https://gerrit.opnfv.org/gerrit/functest-xtesting'
418 refspec: '+refs/heads/*:refs/remotes/origin/* +refs/changes/*:refs/changes/*'
422 - xtesting-dep: &xtesting-dep
423 name: 'xtesting-containers'
427 dependency: '{dependency}'
430 name: xtesting-pull-dep-images
434 if [ "_" = "_" ]; then
435 image=alpine:{dependency}
436 elif [ "" = "None" ]; then
437 image=_/alpine:{dependency}
439 image=_:/alpine:{dependency}
441 docker pull $image || true
444 name: xtesting-remove-dep-images
448 if [ "_" = "_" ]; then
449 image=alpine:{dependency}
450 elif [ "" = "None" ]; then
451 image=_/alpine:{dependency}
453 image=_:/alpine:{dependency}
455 docker rmi $image || true
458 name: 'xtesting-{repo}-{tag}-dep-pull'
463 - xtesting-pull-dep-images:
467 name: 'xtesting-{repo}-{tag}-dep-pull'
470 - 'xtesting-{repo}-{tag}-dep-pull'
473 name: 'xtesting-{repo}-{tag}-dep-rmi'
478 - xtesting-remove-dep-images:
482 name: 'xtesting-{repo}-{tag}-dep-rmi'
485 - 'xtesting-{repo}-{tag}-dep-rmi'
492 apt-get update && apt-get install \
493 software-properties-common gpg -y
494 add-apt-repository -y ppa:deadsnakes/ppa
495 apt-get update && apt-get install python3.8 \
496 python3.8-dev python3.8-distutils \
497 python3.7 python3.7-dev python3.6 python3.6-dev \
498 python python-dev python3-pip enchant -y
499 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 buildargs: '{buildargs}'
538 name: xtesting-opnfv-xtesting-{tag}-gate
544 - 'xtesting-{repo}-{container}-{tag}-gate'
547 name: xtesting-opnfv-xtesting-mts-{tag}-gate
549 container: xtesting-mts
553 - 'xtesting-{repo}-{container}-{tag}-gate'
556 name: xtesting-patchset-created
560 - patchset-created-event
561 - comment-added-contains-event:
562 comment-contains-value: 'recheck'
563 - comment-added-contains-event:
564 comment-contains-value: 'reverify'
566 - project-compare-type: 'ANT'
567 project-pattern: 'functest-xtesting'
569 - branch-compare-type: 'ANT'
570 branch-pattern: '**/{branch}'
573 name: 'xtesting-{tag}-review'
574 project-type: multijob
576 - xtesting-patchset-created:
581 - xtesting-build_tag:
583 # PyYAML and yamllint differ here
584 # see https://github.com/yaml/pyyaml/issues/234
585 # yamllint disable rule:indentation
589 - ^xtesting-(pi-)*{tag}-(daily|docker|review)$
590 # yamllint enable rule:indentation
593 name: remove former images
595 - name: 'xtesting-opnfv-xtesting-{tag}-rmi'
597 - name: 'xtesting-opnfv-xtesting-mts-{tag}-rmi'
600 name: remove dependency
602 - name: 'xtesting-{repo}-{tag}-dep-rmi'
605 name: pull dependency
607 - name: 'xtesting-{repo}-{tag}-dep-pull'
612 - name: 'xtesting-opnfv-xtesting-{tag}-gate'
615 name: opnfv/xtesting-mts
617 - name: 'xtesting-opnfv-xtesting-mts-{tag}-gate'
620 name: opnfv/xtesting:{tag}
622 - name: 'xtesting-opnfv-xtesting-{tag}-first-run'
624 - name: 'xtesting-opnfv-xtesting-{tag}-second-run'
626 - name: 'xtesting-opnfv-xtesting-{tag}-third-run'
628 - name: 'xtesting-opnfv-xtesting-{tag}-fourth-run'
630 - name: 'xtesting-opnfv-xtesting-{tag}-fifth-run'
632 - name: 'xtesting-opnfv-xtesting-{tag}-sixth-run'
634 - name: 'xtesting-opnfv-xtesting-{tag}-eighth-run'
637 name: opnfv/xtesting-mts:{tag}
639 - name: 'xtesting-opnfv-xtesting-mts-{tag}-seventh-run'
643 name: 'xtesting-review'
646 - 'xtesting-{tag}-review'
649 name: xtesting-review
658 regex: ^xtesting-[a-z0-9.]+-review$
670 regex: ^xtesting-[a-z0-9.]+-tox$
673 name: xtesting-push-containers
677 if [ "{repo}" = "_" ]; then
678 image={container}:{tag}
679 elif [ "{port}" = "None" ]; then
680 image={repo}/{container}:{tag}
682 image={repo}:{port}/{container}:{tag}
687 name: xtesting-commit
693 name: 'xtesting-{repo}-{container}-{tag}-build'
701 - xtesting-build-containers:
702 <<: *xtesting-build-containers
704 buildargs: '{buildargs}'
705 - xtesting-push-containers:
706 <<: *xtesting-build-containers
710 name: xtesting-opnfv-xtesting-{tag}-build
716 - 'xtesting-{repo}-{container}-{tag}-build'
719 name: xtesting-opnfv-xtesting-mts-{tag}-build
721 container: xtesting-mts
725 - 'xtesting-{repo}-{container}-{tag}-build'
728 name: 'xtesting-{tag}-docker'
729 project-type: multijob
738 # PyYAML and yamllint differ here
739 # see https://github.com/yaml/pyyaml/issues/234
740 # yamllint disable rule:indentation
744 - ^xtesting-(pi-)*{tag}-(daily|docker|review)$
745 # yamllint enable rule:indentation
748 name: remove dependency
750 - name: 'xtesting-{repo}-{tag}-dep-rmi'
753 name: pull dependency
755 - name: 'xtesting-{repo}-{tag}-dep-pull'
760 - name: 'xtesting-opnfv-xtesting-{tag}-build'
763 name: opnfv/xtesting-mts
765 - name: 'xtesting-opnfv-xtesting-mts-{tag}-build'
772 apt-get update && apt-get install curl -y
774 curl -sfL https://raw.githubusercontent.com/aquasecurity/trivy/main/contrib/install.sh | sh -s -- -b .
775 if [ "{repo}" = "_" ]; then
776 image={container}:{tag}
777 elif [ "{port}" = "None" ]; then
778 image={repo}/{container}:{tag}
780 image={repo}:{port}/{container}:{tag}
782 ./trivy --exit-code 1 $image
785 name: 'xtesting-{repo}-{container}-{tag}-trivy'
793 <<: *xtesting-containers
796 name: 'xtesting-opnfv-xtesting-trivy'
798 container: 'xtesting'
800 - 'xtesting-{repo}-{container}-{tag}-trivy'
803 name: 'xtesting-opnfv-xtesting-mts-trivy'
805 container: 'xtesting-mts'
807 - 'xtesting-{repo}-{container}-{tag}-trivy'
813 - 'xtesting-{tag}-docker'
816 name: xtesting-docker
825 regex: ^xtesting-[a-z0-9.]+-docker$
837 regex: (?!xtesting-pi)^xtesting-[a-z-0-9.]+-trivy$