From: Alfredo Deza Date: Tue, 8 Aug 2017 20:23:27 +0000 (-0400) Subject: ceph-volume-ansible-prs: improve the build script for remote branch detection X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F822%2Fhead;p=ceph-build.git ceph-volume-ansible-prs: improve the build script for remote branch detection Signed-off-by: Alfredo Deza --- diff --git a/ceph-volume-ansible-prs/build/build b/ceph-volume-ansible-prs/build/build index 2f80410c..a81ab452 100644 --- a/ceph-volume-ansible-prs/build/build +++ b/ceph-volume-ansible-prs/build/build @@ -1,14 +1,19 @@ #!/bin/bash set -ex +WORKDIR=$(mktemp -td tox.XXXXXXXXXX) + +# Find out the name of the remote branch from the Pull Request. This is otherwise not +# available by the plugin. Without grepping for `heads` output will look like: +# +# 855ce630695ed9ca53c314b7e261ec3cc499787d refs/heads/wip-volume-tests +BRANCH=`git ls-remote origin | grep $GIT_PREVIOUS_COMMIT | grep heads | cut -d '/' -f 3` # the following two methods exist in scripts/build_utils.sh pkgs=( "tox" ) install_python_packages "pkgs[@]" -# trims leading slashes -BRANCH=`branch_slash_filter ${GIT_BRANCH}` SHA=$GIT_COMMIT +cd src/ceph-volume/ceph_volume/tests/functional -cd src/ceph-volume/tests/functional -CEPH_DEV_BRANCH=$BRANCH CEPH_DEV_SHA1=$SHA tox -vre $DISTRO-$SCENARIO +CEPH_DEV_BRANCH=$BRANCH CEPH_DEV_SHA1=$SHA $VENV/tox --workdir=$WORKDIR -vre $DISTRO-$SCENARIO -- --provider=libvirt