2 - xtesting-containers: &xtesting-containers
3 name: 'xtesting-containers'
6 container: '{container}'
9 - xtesting-params: &xtesting-params
10 name: 'xtesting-params'
51 - xtesting-jobs: &xtesting-jobs
53 current-parameters: true
63 name: xtesting-build_tag
69 - xtesting-run-containers: &xtesting-run-containers
70 name: 'xtesting-run-containers'
71 <<: *xtesting-containers
73 privileged: '{privileged}'
77 name: xtesting-pull-containers
81 if [ "{repo}" = "_" ]; then
82 image={container}:{tag}
83 elif [ "{port}" = "None" ]; then
84 image={repo}/{container}:{tag}
86 image={repo}:{port}/{container}:{tag}
88 sudo docker pull $image
91 name: xtesting-run-containers
95 [ ! -z "$WORKSPACE" ] && sudo rm -rf $WORKSPACE/results || true
96 if [ "{repo}" = "_" ]; then
97 image={container}:{tag}
98 elif [ "{port}" = "None" ]; then
99 image={repo}/{container}:{tag}
101 image={repo}:{port}/{container}:{tag}
103 sudo docker run --rm \
104 --privileged={privileged} \
105 --network={network} \
106 -e S3_ENDPOINT_URL=https://storage.googleapis.com \
107 -e S3_DST_URL=s3://artifacts.opnfv.org/xtesting/$BUILD_TAG/$JOB_NAME-$BUILD_ID \
108 -e HTTP_DST_URL=http://artifacts.opnfv.org/xtesting/$BUILD_TAG/$JOB_NAME-$BUILD_ID \
109 -v /home/opnfv/xtesting/.boto:/root/.boto \
110 -e TEST_DB_URL=http://testresults.opnfv.org/test/api/v1/results \
111 -e TEST_DB_EXT_URL=http://testresults.opnfv.org/test/api/v1/results \
112 -e NODE_NAME=$slave \
113 -e BUILD_TAG=$BUILD_TAG \
114 -v $WORKSPACE/../$JOB_NAME/results:/var/lib/xtesting/results \
115 $image run_tests -t {test} -p -r
118 name: xtesting-remove-images
122 if [ "{repo}" = "_" ]; then
123 image={container}:{tag}
124 elif [ "{port}" = "None" ]; then
125 image={repo}/{container}:{tag}
127 image={repo}:{port}/{container}:{tag}
129 sudo docker rmi $image || true
132 name: 'xtesting-{repo}-{container}-{tag}-pull'
137 - xtesting-pull-containers:
138 <<: *xtesting-containers
141 name: 'xtesting-opnfv-xtesting-pull'
143 container: 'xtesting'
145 - 'xtesting-{repo}-{container}-{tag}-pull'
148 name: 'xtesting-opnfv-xtesting-mts-pull'
150 container: 'xtesting-mts'
152 - 'xtesting-{repo}-{container}-{tag}-pull'
155 name: 'xtesting-{repo}-{container}-{tag}-rmi'
160 - xtesting-remove-images:
161 <<: *xtesting-containers
164 name: 'xtesting-opnfv-xtesting-rmi'
166 container: 'xtesting'
168 - 'xtesting-{repo}-{container}-{tag}-rmi'
171 name: 'xtesting-opnfv-xtesting-mts-rmi'
173 container: 'xtesting-mts'
175 - 'xtesting-{repo}-{container}-{tag}-rmi'
178 name: 'xtesting-{repo}-{container}-{tag}-{test}-run'
182 - xtesting-build_tag:
185 - xtesting-run-containers:
186 <<: *xtesting-run-containers
189 name: 'xtesting-opnfv-xtesting'
191 container: 'xtesting'
202 - 'xtesting-{repo}-{container}-{tag}-{test}-run'
205 name: 'xtesting-opnfv-xtesting-mts'
207 container: 'xtesting-mts'
213 - '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:
270 use-build-blocker: true
271 blocking-level: 'NODE'
273 - '^xtesting-{tag}-(daily|docker|review)$'
276 name: remove former images
278 - name: 'xtesting-opnfv-xtesting-{tag}-rmi'
280 - name: 'xtesting-opnfv-xtesting-mts-{tag}-rmi'
283 name: pull containers
285 - name: 'xtesting-opnfv-xtesting-{tag}-pull'
287 - name: 'xtesting-opnfv-xtesting-mts-{tag}-pull'
290 name: opnfv/xtesting:{tag}
292 - name: 'xtesting-opnfv-xtesting-{tag}-first-run'
294 - name: 'xtesting-opnfv-xtesting-{tag}-second-run'
296 - name: 'xtesting-opnfv-xtesting-{tag}-third-run'
298 - name: 'xtesting-opnfv-xtesting-{tag}-fourth-run'
300 - name: 'xtesting-opnfv-xtesting-{tag}-fifth-run'
302 - name: 'xtesting-opnfv-xtesting-{tag}-sixth-run'
305 name: opnfv/xtesting-mts:{tag}
307 - name: 'xtesting-opnfv-xtesting-mts-{tag}-seventh-run'
310 name: dump all campaign data
312 - name: 'xtesting-{tag}-zip'
316 name: 'xtesting-daily'
319 - 'xtesting-{tag}-daily'
331 regex: ^xtesting-[a-z0-9.]+-daily$
333 - xtesting-build-containers: &xtesting-build-containers
334 name: 'xtesting-build-containers'
335 <<: *xtesting-containers
338 buildargs: '{buildargs}'
342 name: xtesting-build-containers
346 if [ "{repo}" = "_" ]; then
347 image={container}:{tag}
348 elif [ "{port}" = "None" ]; then
349 image={repo}/{container}:{tag}
351 image={repo}:{port}/{container}:{tag}
354 if [ "{buildargs}" != "None" ]; then
355 build_args="{buildargs}"
357 if [ "{ref_arg}" != "None" ]; then
358 build_args="$build_args --build-arg {ref_arg}={ref}"
361 if [ "{from}" != "None" ]; then
362 sed -i {from} Dockerfile
364 sudo docker build $build_args \
365 --pull=false --no-cache --force-rm=true \
372 url: 'https://gerrit.opnfv.org/gerrit/functest-xtesting'
373 refspec: '+refs/heads/*:refs/remotes/origin/* +refs/changes/*:refs/changes/*'
377 - xtesting-dep: &xtesting-dep
378 name: 'xtesting-containers'
382 dependency: '{dependency}'
385 name: xtesting-pull-dep-images
389 if [ "_" = "_" ]; then
390 image=alpine:{dependency}
391 elif [ "" = "None" ]; then
392 image=_/alpine:{dependency}
394 image=_:/alpine:{dependency}
396 sudo docker pull $image || true
399 name: xtesting-remove-dep-images
403 if [ "_" = "_" ]; then
404 image=alpine:{dependency}
405 elif [ "" = "None" ]; then
406 image=_/alpine:{dependency}
408 image=_:/alpine:{dependency}
410 sudo docker rmi $image || true
413 name: 'xtesting-{repo}-{tag}-dep-pull'
418 - xtesting-pull-dep-images:
422 name: 'xtesting-{repo}-{tag}-dep-pull'
425 - 'xtesting-{repo}-{tag}-dep-pull'
428 name: 'xtesting-{repo}-{tag}-dep-rmi'
433 - xtesting-remove-dep-images:
437 name: 'xtesting-{repo}-{tag}-dep-rmi'
440 - 'xtesting-{repo}-{tag}-dep-rmi'
447 sudo apt-get update && sudo apt-get install \
448 software-properties-common gpg -y
449 sudo add-apt-repository -y ppa:deadsnakes/ppa
450 sudo apt-get update && sudo apt-get install python3.8 \
451 python3.8-dev python3.8-distutils \
452 python3.7 python3.7-dev python3.6 python3.6-dev \
453 python python-dev python3-pip enchant -y
454 sudo pip3 install tox tox-pip-version
459 name: 'xtesting-{tag}-tox'
464 - xtesting-patchset-created:
476 - 'xtesting-{tag}-tox'
479 name: 'xtesting-{repo}-{container}-{tag}-gate'
487 - xtesting-build-containers:
488 <<: *xtesting-build-containers
490 buildargs: '{buildargs}'
493 name: xtesting-opnfv-xtesting-{tag}-gate
499 - 'xtesting-{repo}-{container}-{tag}-gate'
502 name: xtesting-opnfv-xtesting-mts-{tag}-gate
504 container: xtesting-mts
508 - 'xtesting-{repo}-{container}-{tag}-gate'
512 name: xtesting-patchset-created
516 - patchset-created-event
517 - comment-added-contains-event:
518 comment-contains-value: 'recheck'
519 - comment-added-contains-event:
520 comment-contains-value: 'reverify'
522 - project-compare-type: 'ANT'
523 project-pattern: 'functest-xtesting'
525 - branch-compare-type: 'ANT'
526 branch-pattern: '**/{branch}'
529 name: 'xtesting-{tag}-review'
530 project-type: multijob
532 - xtesting-patchset-created:
537 - xtesting-build_tag:
541 use-build-blocker: true
542 blocking-level: 'NODE'
544 - '^xtesting-{tag}-(daily|docker|review)$'
547 name: remove former images
549 - name: 'xtesting-opnfv-xtesting-{tag}-rmi'
551 - name: 'xtesting-opnfv-xtesting-mts-{tag}-rmi'
554 name: remove dependency
556 - name: 'xtesting-{repo}-{tag}-dep-rmi'
559 name: pull dependency
561 - name: 'xtesting-{repo}-{tag}-dep-pull'
566 - name: 'xtesting-opnfv-xtesting-{tag}-gate'
569 name: opnfv/xtesting-mts
571 - name: 'xtesting-opnfv-xtesting-mts-{tag}-gate'
574 name: opnfv/xtesting:{tag}
576 - name: 'xtesting-opnfv-xtesting-{tag}-first-run'
578 - name: 'xtesting-opnfv-xtesting-{tag}-second-run'
580 - name: 'xtesting-opnfv-xtesting-{tag}-third-run'
582 - name: 'xtesting-opnfv-xtesting-{tag}-fourth-run'
584 - name: 'xtesting-opnfv-xtesting-{tag}-fifth-run'
586 - name: 'xtesting-opnfv-xtesting-{tag}-sixth-run'
589 name: opnfv/xtesting-mts:{tag}
591 - name: 'xtesting-opnfv-xtesting-mts-{tag}-seventh-run'
595 name: 'xtesting-review'
598 - 'xtesting-{tag}-review'
601 name: xtesting-review
610 regex: ^xtesting-[a-z0-9.]+-review$
622 regex: ^xtesting-[a-z0-9.]+-tox$
625 name: xtesting-push-containers
629 if [ "{repo}" = "_" ]; then
630 image={container}:{tag}
631 elif [ "{port}" = "None" ]; then
632 image={repo}/{container}:{tag}
634 image={repo}:{port}/{container}:{tag}
636 sudo docker push $image
639 name: xtesting-commit
645 name: 'xtesting-{repo}-{container}-{tag}-build'
653 - xtesting-build-containers:
654 <<: *xtesting-build-containers
656 buildargs: '{buildargs}'
657 - xtesting-push-containers:
658 <<: *xtesting-build-containers
662 name: xtesting-opnfv-xtesting-{tag}-build
668 - 'xtesting-{repo}-{container}-{tag}-build'
671 name: xtesting-opnfv-xtesting-mts-{tag}-build
673 container: xtesting-mts
677 - 'xtesting-{repo}-{container}-{tag}-build'
681 name: 'xtesting-{tag}-docker'
682 project-type: multijob
693 use-build-blocker: true
694 blocking-level: 'NODE'
696 - '^xtesting-{tag}-(daily|docker|review)$'
699 name: remove dependency
701 - name: 'xtesting-{repo}-{tag}-dep-rmi'
704 name: pull dependency
706 - name: 'xtesting-{repo}-{tag}-dep-pull'
711 - name: 'xtesting-opnfv-xtesting-{tag}-build'
714 name: opnfv/xtesting-mts
716 - name: 'xtesting-opnfv-xtesting-mts-{tag}-build'
723 sudo apt-get update && sudo apt-get install curl -y
725 curl -sfL https://raw.githubusercontent.com/aquasecurity/trivy/main/contrib/install.sh | sudo sh -s -- -b .
726 if [ "{repo}" = "_" ]; then
727 image={container}:{tag}
728 elif [ "{port}" = "None" ]; then
729 image={repo}/{container}:{tag}
731 image={repo}:{port}/{container}:{tag}
733 ./trivy --exit-code 1 $image
736 name: 'xtesting-{repo}-{container}-{tag}-trivy'
744 <<: *xtesting-containers
747 name: 'xtesting-opnfv-xtesting-trivy'
749 container: 'xtesting'
751 - 'xtesting-{repo}-{container}-{tag}-trivy'
754 name: 'xtesting-opnfv-xtesting-mts-trivy'
756 container: 'xtesting-mts'
758 - 'xtesting-{repo}-{container}-{tag}-trivy'
764 - 'xtesting-{tag}-docker'
767 name: xtesting-docker
776 regex: ^xtesting-[a-z0-9.]+-docker$
788 regex: (?!xtesting-pi)^xtesting-[a-z-0-9.]+-trivy$