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'
222 [ ! -z "$WORKSPACE" ] && sudo rm -rf $WORKSPACE/results || true
223 if [ "{repo}" = "_" ]; then
224 image={container}:{tag}
225 elif [ "{port}" = "None" ]; then
226 image={repo}/{container}:{tag}
228 image={repo}:{port}/{container}:{tag}
230 sudo docker run --rm \
231 -e S3_ENDPOINT_URL=https://storage.googleapis.com \
232 -e S3_DST_URL=s3://artifacts.opnfv.org/xtesting \
233 -e HTTP_DST_URL=http://artifacts.opnfv.org/xtesting \
234 -v /home/opnfv/xtesting/.boto:/root/.boto \
235 -e TEST_DB_URL=http://testresults.opnfv.org/test/api/v1/results \
236 -e TEST_DB_EXT_URL=http://testresults.opnfv.org/test/api/v1/results \
237 -e BUILD_TAG=$BUILD_TAG \
238 -v $WORKSPACE/../$JOB_NAME/results:/var/lib/xtesting/results \
242 name: 'xtesting-{tag}-zip'
246 - xtesting-build_tag:
250 <<: *xtesting-containers
253 name: 'xtesting-{tag}-zip'
255 container: 'xtesting'
257 - 'xtesting-{tag}-zip'
260 name: 'xtesting-{tag}-daily'
261 project-type: multijob
267 - xtesting-build_tag:
269 # PyYAML and yamllint differ here
270 # see https://github.com/yaml/pyyaml/issues/234
271 # yamllint disable rule:indentation
275 - ^xtesting-(pi-)*{tag}-(daily|docker|review)$
276 # yamllint enable rule:indentation
279 name: remove former images
281 - name: 'xtesting-opnfv-xtesting-{tag}-rmi'
283 - name: 'xtesting-opnfv-xtesting-mts-{tag}-rmi'
286 name: pull containers
288 - name: 'xtesting-opnfv-xtesting-{tag}-pull'
290 - name: 'xtesting-opnfv-xtesting-mts-{tag}-pull'
293 name: opnfv/xtesting:{tag}
295 - name: 'xtesting-opnfv-xtesting-{tag}-first-run'
297 - name: 'xtesting-opnfv-xtesting-{tag}-second-run'
299 - name: 'xtesting-opnfv-xtesting-{tag}-third-run'
301 - name: 'xtesting-opnfv-xtesting-{tag}-fourth-run'
303 - name: 'xtesting-opnfv-xtesting-{tag}-fifth-run'
305 - name: 'xtesting-opnfv-xtesting-{tag}-sixth-run'
307 - name: 'xtesting-opnfv-xtesting-{tag}-eighth-run'
310 name: opnfv/xtesting-mts:{tag}
312 - name: 'xtesting-opnfv-xtesting-mts-{tag}-seventh-run'
315 name: dump all campaign data
317 - name: 'xtesting-{tag}-zip'
321 name: 'xtesting-daily'
324 - 'xtesting-{tag}-daily'
336 regex: ^xtesting-[a-z0-9.]+-daily$
338 - xtesting-build-containers: &xtesting-build-containers
339 name: 'xtesting-build-containers'
340 <<: *xtesting-containers
343 buildargs: '{buildargs}'
347 name: xtesting-build-containers
351 if [ "{repo}" = "_" ]; then
352 image={container}:{tag}
353 elif [ "{port}" = "None" ]; then
354 image={repo}/{container}:{tag}
356 image={repo}:{port}/{container}:{tag}
359 if [ "{buildargs}" != "None" ]; then
360 build_args="{buildargs}"
362 if [ "{ref_arg}" != "None" ]; then
363 build_args="$build_args --build-arg {ref_arg}={ref}"
366 if [ "{from}" != "None" ]; then
367 sed -i {from} Dockerfile
369 sudo docker build $build_args \
370 --pull=false --no-cache --force-rm=true \
377 url: 'https://gerrit.opnfv.org/gerrit/functest-xtesting'
378 refspec: '+refs/heads/*:refs/remotes/origin/* +refs/changes/*:refs/changes/*'
382 - xtesting-dep: &xtesting-dep
383 name: 'xtesting-containers'
387 dependency: '{dependency}'
390 name: xtesting-pull-dep-images
394 if [ "_" = "_" ]; then
395 image=alpine:{dependency}
396 elif [ "" = "None" ]; then
397 image=_/alpine:{dependency}
399 image=_:/alpine:{dependency}
401 sudo docker pull $image || true
404 name: xtesting-remove-dep-images
408 if [ "_" = "_" ]; then
409 image=alpine:{dependency}
410 elif [ "" = "None" ]; then
411 image=_/alpine:{dependency}
413 image=_:/alpine:{dependency}
415 sudo docker rmi $image || true
418 name: 'xtesting-{repo}-{tag}-dep-pull'
423 - xtesting-pull-dep-images:
427 name: 'xtesting-{repo}-{tag}-dep-pull'
430 - 'xtesting-{repo}-{tag}-dep-pull'
433 name: 'xtesting-{repo}-{tag}-dep-rmi'
438 - xtesting-remove-dep-images:
442 name: 'xtesting-{repo}-{tag}-dep-rmi'
445 - 'xtesting-{repo}-{tag}-dep-rmi'
452 sudo apt-get update && sudo apt-get install \
453 software-properties-common gpg -y
454 sudo add-apt-repository -y ppa:deadsnakes/ppa
455 sudo apt-get update && sudo apt-get install python3.8 \
456 python3.8-dev python3.8-distutils \
457 python3.7 python3.7-dev python3.6 python3.6-dev \
458 python python-dev python3-pip enchant -y
459 sudo pip3 install tox tox-pip-version
464 name: 'xtesting-{tag}-tox'
469 - xtesting-patchset-created:
481 - 'xtesting-{tag}-tox'
484 name: 'xtesting-{repo}-{container}-{tag}-gate'
492 - xtesting-build-containers:
493 <<: *xtesting-build-containers
495 buildargs: '{buildargs}'
498 name: xtesting-opnfv-xtesting-{tag}-gate
504 - 'xtesting-{repo}-{container}-{tag}-gate'
507 name: xtesting-opnfv-xtesting-mts-{tag}-gate
509 container: xtesting-mts
513 - 'xtesting-{repo}-{container}-{tag}-gate'
516 name: xtesting-patchset-created
520 - patchset-created-event
521 - comment-added-contains-event:
522 comment-contains-value: 'recheck'
523 - comment-added-contains-event:
524 comment-contains-value: 'reverify'
526 - project-compare-type: 'ANT'
527 project-pattern: 'functest-xtesting'
529 - branch-compare-type: 'ANT'
530 branch-pattern: '**/{branch}'
533 name: 'xtesting-{tag}-review'
534 project-type: multijob
536 - xtesting-patchset-created:
541 - xtesting-build_tag:
543 # PyYAML and yamllint differ here
544 # see https://github.com/yaml/pyyaml/issues/234
545 # yamllint disable rule:indentation
549 - ^xtesting-(pi-)*{tag}-(daily|docker|review)$
550 # yamllint enable rule:indentation
553 name: remove former images
555 - name: 'xtesting-opnfv-xtesting-{tag}-rmi'
557 - name: 'xtesting-opnfv-xtesting-mts-{tag}-rmi'
560 name: remove dependency
562 - name: 'xtesting-{repo}-{tag}-dep-rmi'
565 name: pull dependency
567 - name: 'xtesting-{repo}-{tag}-dep-pull'
572 - name: 'xtesting-opnfv-xtesting-{tag}-gate'
575 name: opnfv/xtesting-mts
577 - name: 'xtesting-opnfv-xtesting-mts-{tag}-gate'
580 name: opnfv/xtesting:{tag}
582 - name: 'xtesting-opnfv-xtesting-{tag}-first-run'
584 - name: 'xtesting-opnfv-xtesting-{tag}-second-run'
586 - name: 'xtesting-opnfv-xtesting-{tag}-third-run'
588 - name: 'xtesting-opnfv-xtesting-{tag}-fourth-run'
590 - name: 'xtesting-opnfv-xtesting-{tag}-fifth-run'
592 - name: 'xtesting-opnfv-xtesting-{tag}-sixth-run'
594 - name: 'xtesting-opnfv-xtesting-{tag}-eighth-run'
597 name: opnfv/xtesting-mts:{tag}
599 - name: 'xtesting-opnfv-xtesting-mts-{tag}-seventh-run'
603 name: 'xtesting-review'
606 - 'xtesting-{tag}-review'
609 name: xtesting-review
618 regex: ^xtesting-[a-z0-9.]+-review$
630 regex: ^xtesting-[a-z0-9.]+-tox$
633 name: xtesting-push-containers
637 if [ "{repo}" = "_" ]; then
638 image={container}:{tag}
639 elif [ "{port}" = "None" ]; then
640 image={repo}/{container}:{tag}
642 image={repo}:{port}/{container}:{tag}
644 sudo docker push $image
647 name: xtesting-commit
653 name: 'xtesting-{repo}-{container}-{tag}-build'
661 - xtesting-build-containers:
662 <<: *xtesting-build-containers
664 buildargs: '{buildargs}'
665 - xtesting-push-containers:
666 <<: *xtesting-build-containers
670 name: xtesting-opnfv-xtesting-{tag}-build
676 - 'xtesting-{repo}-{container}-{tag}-build'
679 name: xtesting-opnfv-xtesting-mts-{tag}-build
681 container: xtesting-mts
685 - 'xtesting-{repo}-{container}-{tag}-build'
688 name: 'xtesting-{tag}-docker'
689 project-type: multijob
698 # PyYAML and yamllint differ here
699 # see https://github.com/yaml/pyyaml/issues/234
700 # yamllint disable rule:indentation
704 - ^xtesting-(pi-)*{tag}-(daily|docker|review)$
705 # yamllint enable rule:indentation
708 name: remove dependency
710 - name: 'xtesting-{repo}-{tag}-dep-rmi'
713 name: pull dependency
715 - name: 'xtesting-{repo}-{tag}-dep-pull'
720 - name: 'xtesting-opnfv-xtesting-{tag}-build'
723 name: opnfv/xtesting-mts
725 - name: 'xtesting-opnfv-xtesting-mts-{tag}-build'
732 sudo apt-get update && sudo apt-get install curl -y
734 curl -sfL https://raw.githubusercontent.com/aquasecurity/trivy/main/contrib/install.sh | sudo sh -s -- -b .
735 if [ "{repo}" = "_" ]; then
736 image={container}:{tag}
737 elif [ "{port}" = "None" ]; then
738 image={repo}/{container}:{tag}
740 image={repo}:{port}/{container}:{tag}
742 ./trivy --exit-code 1 $image
745 name: 'xtesting-{repo}-{container}-{tag}-trivy'
753 <<: *xtesting-containers
756 name: 'xtesting-opnfv-xtesting-trivy'
758 container: 'xtesting'
760 - 'xtesting-{repo}-{container}-{tag}-trivy'
763 name: 'xtesting-opnfv-xtesting-mts-trivy'
765 container: 'xtesting-mts'
767 - 'xtesting-{repo}-{container}-{tag}-trivy'
773 - 'xtesting-{tag}-docker'
776 name: xtesting-docker
785 regex: ^xtesting-[a-z0-9.]+-docker$
797 regex: (?!xtesting-pi)^xtesting-[a-z-0-9.]+-trivy$