From 43394189348992ead764bdd8e2280288c55e790b Mon Sep 17 00:00:00 2001 From: Alfredo Deza Date: Tue, 8 Aug 2017 16:23:27 -0400 Subject: [PATCH] ceph-volume-ansible-prs: improve the build script for remote branch detection Signed-off-by: Alfredo Deza --- ceph-volume-ansible-prs/build/build | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) 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 -- 2.47.3