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}'
70 name: xtesting-pull-containers
74 if [ "{repo}" = "_" ]; then
75 image={container}:{tag}
76 elif [ "{port}" = "None" ]; then
77 image={repo}/{container}:{tag}
79 image={repo}:{port}/{container}:{tag}
81 sudo docker pull $image
84 name: xtesting-run-containers
88 [ ! -z "$WORKSPACE" ] && sudo rm -rf $WORKSPACE/results || true
89 if [ "{repo}" = "_" ]; then
90 image={container}:{tag}
91 elif [ "{port}" = "None" ]; then
92 image={repo}/{container}:{tag}
94 image={repo}:{port}/{container}:{tag}
96 sudo docker run --rm \
97 --privileged={privileged} \
99 -e S3_ENDPOINT_URL=https://storage.googleapis.com \
100 -e S3_DST_URL=s3://artifacts.opnfv.org/xtesting/$BUILD_TAG/$JOB_NAME-$BUILD_ID \
101 -e HTTP_DST_URL=http://artifacts.opnfv.org/xtesting/$BUILD_TAG/$JOB_NAME-$BUILD_ID \
102 -v /home/opnfv/xtesting/.boto:/root/.boto \
103 -e TEST_DB_URL=http://testresults.opnfv.org/test/api/v1/results \
104 -e TEST_DB_EXT_URL=http://testresults.opnfv.org/test/api/v1/results \
105 -e NODE_NAME=$slave \
106 -e BUILD_TAG=$BUILD_TAG \
107 -v $WORKSPACE/../$JOB_NAME/results:/var/lib/xtesting/results \
108 $image run_tests -t {test} -p -r
111 name: xtesting-remove-images
115 if [ "{repo}" = "_" ]; then
116 image={container}:{tag}
117 elif [ "{port}" = "None" ]; then
118 image={repo}/{container}:{tag}
120 image={repo}:{port}/{container}:{tag}
122 sudo docker rmi $image || true
125 name: 'xtesting-{repo}-{container}-{tag}-pull'
130 - xtesting-pull-containers:
131 <<: *xtesting-containers
134 name: 'xtesting-opnfv-xtesting-pull'
136 container: 'xtesting'
138 - 'xtesting-{repo}-{container}-{tag}-pull'
141 name: 'xtesting-opnfv-xtesting-mts-pull'
143 container: 'xtesting-mts'
145 - 'xtesting-{repo}-{container}-{tag}-pull'
148 name: 'xtesting-{repo}-{container}-{tag}-rmi'
153 - xtesting-remove-images:
154 <<: *xtesting-containers
157 name: 'xtesting-opnfv-xtesting-rmi'
159 container: 'xtesting'
161 - 'xtesting-{repo}-{container}-{tag}-rmi'
164 name: 'xtesting-opnfv-xtesting-mts-rmi'
166 container: 'xtesting-mts'
168 - 'xtesting-{repo}-{container}-{tag}-rmi'
171 name: 'xtesting-{repo}-{container}-{tag}-{test}-run'
175 - xtesting-build_tag:
178 - xtesting-run-containers:
179 <<: *xtesting-run-containers
182 name: 'xtesting-opnfv-xtesting'
184 container: 'xtesting'
203 - 'xtesting-{repo}-{container}-{tag}-{test}-run'
206 name: 'xtesting-opnfv-xtesting-mts'
208 container: 'xtesting-mts'
214 - 'xtesting-{repo}-{container}-{tag}-{test}-run'
221 [ ! -z "$WORKSPACE" ] && sudo rm -rf $WORKSPACE/results || true
222 if [ "{repo}" = "_" ]; then
223 image={container}:{tag}
224 elif [ "{port}" = "None" ]; then
225 image={repo}/{container}:{tag}
227 image={repo}:{port}/{container}:{tag}
229 sudo docker run --rm \
230 -e S3_ENDPOINT_URL=https://storage.googleapis.com \
231 -e S3_DST_URL=s3://artifacts.opnfv.org/xtesting \
232 -e HTTP_DST_URL=http://artifacts.opnfv.org/xtesting \
233 -v /home/opnfv/xtesting/.boto:/root/.boto \
234 -e TEST_DB_URL=http://testresults.opnfv.org/test/api/v1/results \
235 -e TEST_DB_EXT_URL=http://testresults.opnfv.org/test/api/v1/results \
236 -e BUILD_TAG=$BUILD_TAG \
237 -v $WORKSPACE/../$JOB_NAME/results:/var/lib/xtesting/results \
241 name: 'xtesting-{tag}-zip'
245 - xtesting-build_tag:
249 <<: *xtesting-containers
252 name: 'xtesting-{tag}-zip'
254 container: 'xtesting'
256 - 'xtesting-{tag}-zip'
259 name: 'xtesting-{tag}-daily'
260 project-type: multijob
266 - xtesting-build_tag:
268 # PyYAML and yamllint differ here
269 # see https://github.com/yaml/pyyaml/issues/234
270 # yamllint disable rule:indentation
274 - ^xtesting-(pi-)*{tag}-(daily|docker|review)$
275 # yamllint enable rule:indentation
278 name: remove former images
280 - name: 'xtesting-opnfv-xtesting-{tag}-rmi'
282 - name: 'xtesting-opnfv-xtesting-mts-{tag}-rmi'
285 name: pull containers
287 - name: 'xtesting-opnfv-xtesting-{tag}-pull'
289 - name: 'xtesting-opnfv-xtesting-mts-{tag}-pull'
292 name: opnfv/xtesting:{tag}
294 - name: 'xtesting-opnfv-xtesting-{tag}-first-run'
296 - name: 'xtesting-opnfv-xtesting-{tag}-second-run'
298 - name: 'xtesting-opnfv-xtesting-{tag}-third-run'
300 - name: 'xtesting-opnfv-xtesting-{tag}-fourth-run'
302 - name: 'xtesting-opnfv-xtesting-{tag}-fifth-run'
304 - name: 'xtesting-opnfv-xtesting-{tag}-sixth-run'
306 - name: 'xtesting-opnfv-xtesting-{tag}-eighth-run'
309 name: opnfv/xtesting-mts:{tag}
311 - name: 'xtesting-opnfv-xtesting-mts-{tag}-seventh-run'
314 name: dump all campaign data
316 - name: 'xtesting-{tag}-zip'
320 name: 'xtesting-daily'
323 - 'xtesting-{tag}-daily'
335 regex: ^xtesting-[a-z0-9.]+-daily$
337 - xtesting-build-containers: &xtesting-build-containers
338 name: 'xtesting-build-containers'
339 <<: *xtesting-containers
342 buildargs: '{buildargs}'
346 name: xtesting-build-containers
350 if [ "{repo}" = "_" ]; then
351 image={container}:{tag}
352 elif [ "{port}" = "None" ]; then
353 image={repo}/{container}:{tag}
355 image={repo}:{port}/{container}:{tag}
358 if [ "{buildargs}" != "None" ]; then
359 build_args="{buildargs}"
361 if [ "{ref_arg}" != "None" ]; then
362 build_args="$build_args --build-arg {ref_arg}={ref}"
365 if [ "{from}" != "None" ]; then
366 sed -i {from} Dockerfile
368 sudo docker build $build_args \
369 --pull=false --no-cache --force-rm=true \
376 url: 'https://gerrit.opnfv.org/gerrit/functest-xtesting'
377 refspec: '+refs/heads/*:refs/remotes/origin/* +refs/changes/*:refs/changes/*'
381 - xtesting-dep: &xtesting-dep
382 name: 'xtesting-containers'
386 dependency: '{dependency}'
389 name: xtesting-pull-dep-images
393 if [ "_" = "_" ]; then
394 image=alpine:{dependency}
395 elif [ "" = "None" ]; then
396 image=_/alpine:{dependency}
398 image=_:/alpine:{dependency}
400 sudo docker pull $image || true
403 name: xtesting-remove-dep-images
407 if [ "_" = "_" ]; then
408 image=alpine:{dependency}
409 elif [ "" = "None" ]; then
410 image=_/alpine:{dependency}
412 image=_:/alpine:{dependency}
414 sudo docker rmi $image || true
417 name: 'xtesting-{repo}-{tag}-dep-pull'
422 - xtesting-pull-dep-images:
426 name: 'xtesting-{repo}-{tag}-dep-pull'
429 - 'xtesting-{repo}-{tag}-dep-pull'
432 name: 'xtesting-{repo}-{tag}-dep-rmi'
437 - xtesting-remove-dep-images:
441 name: 'xtesting-{repo}-{tag}-dep-rmi'
444 - 'xtesting-{repo}-{tag}-dep-rmi'
451 sudo apt-get update && sudo apt-get install \
452 software-properties-common gpg -y
453 sudo add-apt-repository -y ppa:deadsnakes/ppa
454 sudo apt-get update && sudo apt-get install python3.8 \
455 python3.8-dev python3.8-distutils \
456 python3.7 python3.7-dev python3.6 python3.6-dev \
457 python python-dev python3-pip enchant -y
458 sudo pip3 install tox tox-pip-version
463 name: 'xtesting-{tag}-tox'
468 - xtesting-patchset-created:
480 - 'xtesting-{tag}-tox'
483 name: 'xtesting-{repo}-{container}-{tag}-gate'
491 - xtesting-build-containers:
492 <<: *xtesting-build-containers
494 buildargs: '{buildargs}'
497 name: xtesting-opnfv-xtesting-{tag}-gate
503 - 'xtesting-{repo}-{container}-{tag}-gate'
506 name: xtesting-opnfv-xtesting-mts-{tag}-gate
508 container: xtesting-mts
512 - 'xtesting-{repo}-{container}-{tag}-gate'
515 name: xtesting-patchset-created
519 - patchset-created-event
520 - comment-added-contains-event:
521 comment-contains-value: 'recheck'
522 - comment-added-contains-event:
523 comment-contains-value: 'reverify'
525 - project-compare-type: 'ANT'
526 project-pattern: 'functest-xtesting'
528 - branch-compare-type: 'ANT'
529 branch-pattern: '**/{branch}'
532 name: 'xtesting-{tag}-review'
533 project-type: multijob
535 - xtesting-patchset-created:
540 - xtesting-build_tag:
542 # PyYAML and yamllint differ here
543 # see https://github.com/yaml/pyyaml/issues/234
544 # yamllint disable rule:indentation
548 - ^xtesting-(pi-)*{tag}-(daily|docker|review)$
549 # yamllint enable rule:indentation
552 name: remove former images
554 - name: 'xtesting-opnfv-xtesting-{tag}-rmi'
556 - name: 'xtesting-opnfv-xtesting-mts-{tag}-rmi'
559 name: remove dependency
561 - name: 'xtesting-{repo}-{tag}-dep-rmi'
564 name: pull dependency
566 - name: 'xtesting-{repo}-{tag}-dep-pull'
571 - name: 'xtesting-opnfv-xtesting-{tag}-gate'
574 name: opnfv/xtesting-mts
576 - name: 'xtesting-opnfv-xtesting-mts-{tag}-gate'
579 name: opnfv/xtesting:{tag}
581 - name: 'xtesting-opnfv-xtesting-{tag}-first-run'
583 - name: 'xtesting-opnfv-xtesting-{tag}-second-run'
585 - name: 'xtesting-opnfv-xtesting-{tag}-third-run'
587 - name: 'xtesting-opnfv-xtesting-{tag}-fourth-run'
589 - name: 'xtesting-opnfv-xtesting-{tag}-fifth-run'
591 - name: 'xtesting-opnfv-xtesting-{tag}-sixth-run'
593 - name: 'xtesting-opnfv-xtesting-{tag}-eighth-run'
596 name: opnfv/xtesting-mts:{tag}
598 - name: 'xtesting-opnfv-xtesting-mts-{tag}-seventh-run'
602 name: 'xtesting-review'
605 - 'xtesting-{tag}-review'
608 name: xtesting-review
617 regex: ^xtesting-[a-z0-9.]+-review$
629 regex: ^xtesting-[a-z0-9.]+-tox$
632 name: xtesting-push-containers
636 if [ "{repo}" = "_" ]; then
637 image={container}:{tag}
638 elif [ "{port}" = "None" ]; then
639 image={repo}/{container}:{tag}
641 image={repo}:{port}/{container}:{tag}
643 sudo docker push $image
646 name: xtesting-commit
652 name: 'xtesting-{repo}-{container}-{tag}-build'
660 - xtesting-build-containers:
661 <<: *xtesting-build-containers
663 buildargs: '{buildargs}'
664 - xtesting-push-containers:
665 <<: *xtesting-build-containers
669 name: xtesting-opnfv-xtesting-{tag}-build
675 - 'xtesting-{repo}-{container}-{tag}-build'
678 name: xtesting-opnfv-xtesting-mts-{tag}-build
680 container: xtesting-mts
684 - 'xtesting-{repo}-{container}-{tag}-build'
687 name: 'xtesting-{tag}-docker'
688 project-type: multijob
697 # PyYAML and yamllint differ here
698 # see https://github.com/yaml/pyyaml/issues/234
699 # yamllint disable rule:indentation
703 - ^xtesting-(pi-)*{tag}-(daily|docker|review)$
704 # yamllint enable rule:indentation
707 name: remove dependency
709 - name: 'xtesting-{repo}-{tag}-dep-rmi'
712 name: pull dependency
714 - name: 'xtesting-{repo}-{tag}-dep-pull'
719 - name: 'xtesting-opnfv-xtesting-{tag}-build'
722 name: opnfv/xtesting-mts
724 - name: 'xtesting-opnfv-xtesting-mts-{tag}-build'
731 sudo apt-get update && sudo apt-get install curl -y
733 curl -sfL https://raw.githubusercontent.com/aquasecurity/trivy/main/contrib/install.sh | sudo sh -s -- -b .
734 if [ "{repo}" = "_" ]; then
735 image={container}:{tag}
736 elif [ "{port}" = "None" ]; then
737 image={repo}/{container}:{tag}
739 image={repo}:{port}/{container}:{tag}
741 ./trivy --exit-code 1 $image
744 name: 'xtesting-{repo}-{container}-{tag}-trivy'
752 <<: *xtesting-containers
755 name: 'xtesting-opnfv-xtesting-trivy'
757 container: 'xtesting'
759 - 'xtesting-{repo}-{container}-{tag}-trivy'
762 name: 'xtesting-opnfv-xtesting-mts-trivy'
764 container: 'xtesting-mts'
766 - 'xtesting-{repo}-{container}-{tag}-trivy'
772 - 'xtesting-{tag}-docker'
775 name: xtesting-docker
784 regex: ^xtesting-[a-z0-9.]+-docker$
796 regex: (?!xtesting-pi)^xtesting-[a-z-0-9.]+-trivy$