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'
248 volumes=; for i in $(echo {volumes} | tr -d '[] ' |sed "s/,/ /g" ); do volumes="-v $i $volumes"; done
249 env=; for i in $(eval echo {env} | tr -d '[] ' |sed "s/,/ /g" ); do env="-e $i $env"; done
250 [ ! -z "$WORKSPACE" ] && rm -rf $WORKSPACE/results || true
251 if [ "{repo}" = "_" ]; then
252 image={container}:{tag}
253 elif [ "{port}" = "None" ]; then
254 image={repo}/{container}:{tag}
256 image={repo}:{port}/{container}:{tag}
261 -e S3_ENDPOINT_URL=https://storage.googleapis.com \
262 -e S3_DST_URL=s3://artifacts.opnfv.org/xtesting \
263 -e HTTP_DST_URL=http://artifacts.opnfv.org/xtesting \
264 -v /home/opnfv/xtesting/.boto:/root/.boto \
265 -e TEST_DB_URL=http://testresults.opnfv.org/test/api/v1/results \
266 -e TEST_DB_EXT_URL=http://testresults.opnfv.org/test/api/v1/results \
267 -e BUILD_TAG=$BUILD_TAG \
268 -v $WORKSPACE/../$JOB_NAME/results:/var/lib/xtesting/results \
272 name: 'xtesting-{tag}-zip'
276 - xtesting-build_tag:
280 <<: *xtesting-containers
285 name: 'xtesting-{tag}-zip'
289 container: 'xtesting'
291 - 'xtesting-{tag}-zip'
294 name: 'xtesting-{tag}-daily'
295 project-type: multijob
301 - xtesting-build_tag:
303 # PyYAML and yamllint differ here
304 # see https://github.com/yaml/pyyaml/issues/234
305 # yamllint disable rule:indentation
309 - ^xtesting-(pi-)*{tag}-(daily|docker|review)$
310 # yamllint enable rule:indentation
313 name: remove former images
315 - name: 'xtesting-opnfv-xtesting-{tag}-rmi'
317 - name: 'xtesting-opnfv-xtesting-mts-{tag}-rmi'
320 name: pull containers
322 - name: 'xtesting-opnfv-xtesting-{tag}-pull'
324 - name: 'xtesting-opnfv-xtesting-mts-{tag}-pull'
327 name: opnfv/xtesting:{tag}
329 - name: 'xtesting-opnfv-xtesting-{tag}-first-run'
331 - name: 'xtesting-opnfv-xtesting-{tag}-second-run'
333 - name: 'xtesting-opnfv-xtesting-{tag}-third-run'
335 - name: 'xtesting-opnfv-xtesting-{tag}-fourth-run'
337 - name: 'xtesting-opnfv-xtesting-{tag}-fifth-run'
339 - name: 'xtesting-opnfv-xtesting-{tag}-sixth-run'
341 - name: 'xtesting-opnfv-xtesting-{tag}-eighth-run'
344 name: opnfv/xtesting-mts:{tag}
346 - name: 'xtesting-opnfv-xtesting-mts-{tag}-seventh-run'
349 name: dump all campaign data
351 - name: 'xtesting-{tag}-zip'
355 name: 'xtesting-daily'
358 - 'xtesting-{tag}-daily'
370 regex: ^xtesting-[a-z0-9.]+-daily$
372 - xtesting-build-containers: &xtesting-build-containers
373 name: 'xtesting-build-containers'
374 <<: *xtesting-containers
377 buildargs: '{buildargs}'
381 name: xtesting-build-containers
385 if [ "{repo}" = "_" ]; then
386 image={container}:{tag}
387 elif [ "{port}" = "None" ]; then
388 image={repo}/{container}:{tag}
390 image={repo}:{port}/{container}:{tag}
393 if [ "{buildargs}" != "None" ]; then
394 build_args="{buildargs}"
396 if [ "{ref_arg}" != "None" ]; then
397 build_args="$build_args --build-arg {ref_arg}={ref}"
400 if [ "{from}" != "None" ]; then
401 sed -i {from} Dockerfile
403 docker build $build_args \
404 --pull=false --no-cache --force-rm=true \
411 url: 'https://gerrit.opnfv.org/gerrit/functest-xtesting'
412 refspec: '+refs/heads/*:refs/remotes/origin/* +refs/changes/*:refs/changes/*'
416 - xtesting-dep: &xtesting-dep
417 name: 'xtesting-containers'
421 dependency: '{dependency}'
424 name: xtesting-pull-dep-images
428 if [ "_" = "_" ]; then
429 image=alpine:{dependency}
430 elif [ "" = "None" ]; then
431 image=_/alpine:{dependency}
433 image=_:/alpine:{dependency}
435 docker pull $image || true
438 name: xtesting-remove-dep-images
442 if [ "_" = "_" ]; then
443 image=alpine:{dependency}
444 elif [ "" = "None" ]; then
445 image=_/alpine:{dependency}
447 image=_:/alpine:{dependency}
449 docker rmi $image || true
452 name: 'xtesting-{repo}-{tag}-dep-pull'
457 - xtesting-pull-dep-images:
461 name: 'xtesting-{repo}-{tag}-dep-pull'
464 - 'xtesting-{repo}-{tag}-dep-pull'
467 name: 'xtesting-{repo}-{tag}-dep-rmi'
472 - xtesting-remove-dep-images:
476 name: 'xtesting-{repo}-{tag}-dep-rmi'
479 - 'xtesting-{repo}-{tag}-dep-rmi'
486 apt-get update && apt-get install \
487 software-properties-common gpg -y
488 add-apt-repository -y ppa:deadsnakes/ppa
489 apt-get update && apt-get install python3.8 \
490 python3.8-dev python3.8-distutils \
491 python3.7 python3.7-dev python3.6 python3.6-dev \
492 python python-dev python3-pip enchant -y
493 pip3 install tox tox-pip-version
498 name: 'xtesting-{tag}-tox'
503 - xtesting-patchset-created:
515 - 'xtesting-{tag}-tox'
518 name: 'xtesting-{repo}-{container}-{tag}-gate'
526 - xtesting-build-containers:
527 <<: *xtesting-build-containers
529 buildargs: '{buildargs}'
532 name: xtesting-opnfv-xtesting-{tag}-gate
538 - 'xtesting-{repo}-{container}-{tag}-gate'
541 name: xtesting-opnfv-xtesting-mts-{tag}-gate
543 container: xtesting-mts
547 - 'xtesting-{repo}-{container}-{tag}-gate'
550 name: xtesting-patchset-created
554 - patchset-created-event
555 - comment-added-contains-event:
556 comment-contains-value: 'recheck'
557 - comment-added-contains-event:
558 comment-contains-value: 'reverify'
560 - project-compare-type: 'ANT'
561 project-pattern: 'functest-xtesting'
563 - branch-compare-type: 'ANT'
564 branch-pattern: '**/{branch}'
567 name: 'xtesting-{tag}-review'
568 project-type: multijob
570 - xtesting-patchset-created:
575 - xtesting-build_tag:
577 # PyYAML and yamllint differ here
578 # see https://github.com/yaml/pyyaml/issues/234
579 # yamllint disable rule:indentation
583 - ^xtesting-(pi-)*{tag}-(daily|docker|review)$
584 # yamllint enable rule:indentation
587 name: remove former images
589 - name: 'xtesting-opnfv-xtesting-{tag}-rmi'
591 - name: 'xtesting-opnfv-xtesting-mts-{tag}-rmi'
594 name: remove dependency
596 - name: 'xtesting-{repo}-{tag}-dep-rmi'
599 name: pull dependency
601 - name: 'xtesting-{repo}-{tag}-dep-pull'
606 - name: 'xtesting-opnfv-xtesting-{tag}-gate'
609 name: opnfv/xtesting-mts
611 - name: 'xtesting-opnfv-xtesting-mts-{tag}-gate'
614 name: opnfv/xtesting:{tag}
616 - name: 'xtesting-opnfv-xtesting-{tag}-first-run'
618 - name: 'xtesting-opnfv-xtesting-{tag}-second-run'
620 - name: 'xtesting-opnfv-xtesting-{tag}-third-run'
622 - name: 'xtesting-opnfv-xtesting-{tag}-fourth-run'
624 - name: 'xtesting-opnfv-xtesting-{tag}-fifth-run'
626 - name: 'xtesting-opnfv-xtesting-{tag}-sixth-run'
628 - name: 'xtesting-opnfv-xtesting-{tag}-eighth-run'
631 name: opnfv/xtesting-mts:{tag}
633 - name: 'xtesting-opnfv-xtesting-mts-{tag}-seventh-run'
637 name: 'xtesting-review'
640 - 'xtesting-{tag}-review'
643 name: xtesting-review
652 regex: ^xtesting-[a-z0-9.]+-review$
664 regex: ^xtesting-[a-z0-9.]+-tox$
667 name: xtesting-push-containers
671 if [ "{repo}" = "_" ]; then
672 image={container}:{tag}
673 elif [ "{port}" = "None" ]; then
674 image={repo}/{container}:{tag}
676 image={repo}:{port}/{container}:{tag}
681 name: xtesting-commit
687 name: 'xtesting-{repo}-{container}-{tag}-build'
695 - xtesting-build-containers:
696 <<: *xtesting-build-containers
698 buildargs: '{buildargs}'
699 - xtesting-push-containers:
700 <<: *xtesting-build-containers
704 name: xtesting-opnfv-xtesting-{tag}-build
710 - 'xtesting-{repo}-{container}-{tag}-build'
713 name: xtesting-opnfv-xtesting-mts-{tag}-build
715 container: xtesting-mts
719 - 'xtesting-{repo}-{container}-{tag}-build'
722 name: 'xtesting-{tag}-docker'
723 project-type: multijob
732 # PyYAML and yamllint differ here
733 # see https://github.com/yaml/pyyaml/issues/234
734 # yamllint disable rule:indentation
738 - ^xtesting-(pi-)*{tag}-(daily|docker|review)$
739 # yamllint enable rule:indentation
742 name: remove dependency
744 - name: 'xtesting-{repo}-{tag}-dep-rmi'
747 name: pull dependency
749 - name: 'xtesting-{repo}-{tag}-dep-pull'
754 - name: 'xtesting-opnfv-xtesting-{tag}-build'
757 name: opnfv/xtesting-mts
759 - name: 'xtesting-opnfv-xtesting-mts-{tag}-build'
766 apt-get update && apt-get install curl -y
768 curl -sfL https://raw.githubusercontent.com/aquasecurity/trivy/main/contrib/install.sh | sh -s -- -b .
769 if [ "{repo}" = "_" ]; then
770 image={container}:{tag}
771 elif [ "{port}" = "None" ]; then
772 image={repo}/{container}:{tag}
774 image={repo}:{port}/{container}:{tag}
776 ./trivy --exit-code 1 $image
779 name: 'xtesting-{repo}-{container}-{tag}-trivy'
787 <<: *xtesting-containers
790 name: 'xtesting-opnfv-xtesting-trivy'
792 container: 'xtesting'
794 - 'xtesting-{repo}-{container}-{tag}-trivy'
797 name: 'xtesting-opnfv-xtesting-mts-trivy'
799 container: 'xtesting-mts'
801 - 'xtesting-{repo}-{container}-{tag}-trivy'
807 - 'xtesting-{tag}-docker'
810 name: xtesting-docker
819 regex: ^xtesting-[a-z0-9.]+-docker$
831 regex: (?!xtesting-pi)^xtesting-[a-z-0-9.]+-trivy$