diff options
Diffstat (limited to 'jjb/functest/xtesting.yaml')
-rw-r--r-- | jjb/functest/xtesting.yaml | 104 |
1 files changed, 69 insertions, 35 deletions
diff --git a/jjb/functest/xtesting.yaml b/jjb/functest/xtesting.yaml index 1239ad0be..4ad16d0d9 100644 --- a/jjb/functest/xtesting.yaml +++ b/jjb/functest/xtesting.yaml @@ -59,12 +59,13 @@ - random-string: name: build_tag - - xtesting-run-containers: &xtesting-run-containers name: 'xtesting-run-containers' <<: *xtesting-containers test: '{test}' privileged: '{privileged}' + volumes: '{volumes}' + env: '{env}' network: '{network}' - builder: @@ -79,14 +80,16 @@ else image={repo}:{port}/{container}:{tag} fi - sudo docker pull $image + docker pull $image - builder: name: xtesting-run-containers builders: - shell: | set +x - [ ! -z "$WORKSPACE" ] && sudo rm -rf $WORKSPACE/results || true + volumes=; for i in $(echo {volumes} | tr -d '[] ' |sed "s/,/ /g" ); do volumes="-v $i $volumes"; done + env=; for i in $(eval echo {env} | tr -d '[] ' |sed "s/,/ /g" ); do env="-e $i $env"; done + [ ! -z "$WORKSPACE" ] && rm -rf $WORKSPACE/results || true if [ "{repo}" = "_" ]; then image={container}:{tag} elif [ "{port}" = "None" ]; then @@ -94,9 +97,11 @@ else image={repo}:{port}/{container}:{tag} fi - sudo docker run --rm \ + docker run --rm \ --privileged={privileged} \ --network={network} \ + $volumes \ + $env \ -e S3_ENDPOINT_URL=https://storage.googleapis.com \ -e S3_DST_URL=s3://artifacts.opnfv.org/xtesting/$BUILD_TAG/$JOB_NAME-$BUILD_ID \ -e HTTP_DST_URL=http://artifacts.opnfv.org/xtesting/$BUILD_TAG/$JOB_NAME-$BUILD_ID \ @@ -120,7 +125,7 @@ else image={repo}:{port}/{container}:{tag} fi - sudo docker rmi $image || true + docker rmi $image || true - job-template: name: 'xtesting-{repo}-{container}-{tag}-pull' @@ -169,7 +174,7 @@ - 'xtesting-{repo}-{container}-{tag}-rmi' - job-template: - name: 'xtesting-{repo}-{container}-{tag}-{test}-run' + name: 'xtesting-opnfv-xtesting-{tag}-{test}-run' parameters: - xtesting-slave: slave: '{slave}' @@ -182,6 +187,8 @@ - project: name: 'xtesting-opnfv-xtesting' <<: *xtesting-params + volumes: + env: container: 'xtesting' test: - first @@ -194,30 +201,47 @@ privileged: 'false' network: bridge exclude: - - {'tag': 'leguer', 'test': 'eighth'} - - {'tag': 'kali', 'test': 'eighth'} - - {'tag': 'jerma', 'test': 'eighth'} + - tag: leguer + test: eighth + - tag: kali + test: eighth + - tag: jerma + test: eighth jobs: - - 'xtesting-{repo}-{container}-{tag}-{test}-run' + - 'xtesting-opnfv-xtesting-{tag}-{test}-run' + +- job-template: + name: 'xtesting-opnfv-xtesting-mts-{tag}-{test}-run' + parameters: + - xtesting-slave: + slave: '{slave}' + - xtesting-build_tag: + build_tag: '' + builders: + - xtesting-run-containers: + <<: *xtesting-run-containers - project: name: 'xtesting-opnfv-xtesting-mts' <<: *xtesting-params + volumes: + env: container: 'xtesting-mts' test: - seventh privileged: 'false' network: bridge jobs: - - 'xtesting-{repo}-{container}-{tag}-{test}-run' - + - 'xtesting-opnfv-xtesting-mts-{tag}-{test}-run' - builder: name: xtesting-zip builders: - shell: | set +x - [ ! -z "$WORKSPACE" ] && sudo rm -rf $WORKSPACE/results || true + volumes=; for i in $(echo {volumes} | tr -d '[] ' |sed "s/,/ /g" ); do volumes="-v $i $volumes"; done + env=; for i in $(eval echo {env} | tr -d '[] ' |sed "s/,/ /g" ); do env="-e $i $env"; done + [ ! -z "$WORKSPACE" ] && rm -rf $WORKSPACE/results || true if [ "{repo}" = "_" ]; then image={container}:{tag} elif [ "{port}" = "None" ]; then @@ -225,7 +249,9 @@ else image={repo}:{port}/{container}:{tag} fi - sudo docker run --rm \ + docker run --rm \ + $volumes \ + $env \ -e S3_ENDPOINT_URL=https://storage.googleapis.com \ -e S3_DST_URL=s3://artifacts.opnfv.org/xtesting \ -e HTTP_DST_URL=http://artifacts.opnfv.org/xtesting \ @@ -246,10 +272,14 @@ builders: - xtesting-zip: <<: *xtesting-containers + volumes: '{volumes}' + env: '{env}' - project: name: 'xtesting-{tag}-zip' <<: *xtesting-params + volumes: + env: container: 'xtesting' jobs: - 'xtesting-{tag}-zip' @@ -264,12 +294,14 @@ slave: '{slave}' - xtesting-build_tag: build_tag: '' + # PyYAML and yamllint differ here + # see https://github.com/yaml/pyyaml/issues/234 + # yamllint disable rule:indentation properties: - build-blocker: - use-build-blocker: true - blocking-level: 'NODE' blocking-jobs: - - '^xtesting-{tag}-(daily|docker|review)$' + - ^xtesting-(pi-)*{tag}-(daily|docker|review)$ + # yamllint enable rule:indentation builders: - multijob: name: remove former images @@ -362,7 +394,7 @@ if [ "{from}" != "None" ]; then sed -i {from} Dockerfile fi - sudo docker build $build_args \ + docker build $build_args \ --pull=false --no-cache --force-rm=true \ -t $image . @@ -394,7 +426,7 @@ else image=_:/alpine:{dependency} fi - sudo docker pull $image || true + docker pull $image || true - builder: name: xtesting-remove-dep-images @@ -408,7 +440,7 @@ else image=_:/alpine:{dependency} fi - sudo docker rmi $image || true + docker rmi $image || true - job-template: name: 'xtesting-{repo}-{tag}-dep-pull' @@ -445,14 +477,14 @@ builders: - shell: | set +x - sudo apt-get update && sudo apt-get install \ + apt-get update && apt-get install \ software-properties-common gpg -y - sudo add-apt-repository -y ppa:deadsnakes/ppa - sudo apt-get update && sudo apt-get install python3.8 \ + add-apt-repository -y ppa:deadsnakes/ppa + apt-get update && apt-get install python3.8 \ python3.8-dev python3.8-distutils \ python3.7 python3.7-dev python3.6 python3.6-dev \ python python-dev python3-pip enchant -y - sudo pip3 install tox tox-pip-version + pip3 install tox tox-pip-version tox @@ -508,7 +540,6 @@ jobs: - 'xtesting-{repo}-{container}-{tag}-gate' - - trigger: name: xtesting-patchset-created triggers: @@ -537,12 +568,14 @@ slave: '{slave}' - xtesting-build_tag: build_tag: '' + # PyYAML and yamllint differ here + # see https://github.com/yaml/pyyaml/issues/234 + # yamllint disable rule:indentation properties: - build-blocker: - use-build-blocker: true - blocking-level: 'NODE' blocking-jobs: - - '^xtesting-{tag}-(daily|docker|review)$' + - ^xtesting-(pi-)*{tag}-(daily|docker|review)$ + # yamllint enable rule:indentation builders: - multijob: name: remove former images @@ -636,7 +669,7 @@ else image={repo}:{port}/{container}:{tag} fi - sudo docker push $image + docker push $image - trigger: name: xtesting-commit @@ -679,7 +712,6 @@ jobs: - 'xtesting-{repo}-{container}-{tag}-build' - - job-template: name: 'xtesting-{tag}-docker' project-type: multijob @@ -691,12 +723,14 @@ parameters: - xtesting-slave: slave: '{slave}' + # PyYAML and yamllint differ here + # see https://github.com/yaml/pyyaml/issues/234 + # yamllint disable rule:indentation properties: - build-blocker: - use-build-blocker: true - blocking-level: 'NODE' blocking-jobs: - - '^xtesting-{tag}-(daily|docker|review)$' + - ^xtesting-(pi-)*{tag}-(daily|docker|review)$ + # yamllint enable rule:indentation builders: - multijob: name: remove dependency @@ -723,9 +757,9 @@ name: xtesting-trivy builders: - shell: | - sudo apt-get update && sudo apt-get install curl -y + apt-get update && apt-get install curl -y - curl -sfL https://raw.githubusercontent.com/aquasecurity/trivy/main/contrib/install.sh | sudo sh -s -- -b . + curl -sfL https://raw.githubusercontent.com/aquasecurity/trivy/main/contrib/install.sh | sh -s -- -b . if [ "{repo}" = "_" ]; then image={container}:{tag} elif [ "{port}" = "None" ]; then |