]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph-build.git/commitdiff
ceph-volume-ansible-prs: improve the build script for remote branch detection 822/head
authorAlfredo Deza <adeza@redhat.com>
Tue, 8 Aug 2017 20:23:27 +0000 (16:23 -0400)
committerAlfredo Deza <adeza@redhat.com>
Tue, 8 Aug 2017 20:23:27 +0000 (16:23 -0400)
Signed-off-by: Alfredo Deza <adeza@redhat.com>
ceph-volume-ansible-prs/build/build

index 2f80410c57cf38ac13b7efac864d6dbcaf8a7b4f..a81ab45260792a821511daac6d21467738f3c22b 100644 (file)
@@ -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