tox_install: speed up neutron repo clone

When installing neutron repo into tox venv, there is no need to
use full clone. Shallow clone like --depth 1 is sufficient.
It speeds up tox venv creation.

In my local env, the data volume transferred during neutron repo clone
was reduced from around 50MB to 3.6MB and the time take was reduced
from 60sec to 13sec. In slower network connection environments,
it would have an positive effect more.

Change-Id: Ib8964fc029a2eab839c8022ad48ef40541e83780
This commit is contained in:
Akihiro Motoki 2017-05-22 12:54:01 +09:00
parent 8589bf30a9
commit 1fdee46b5c
1 changed files with 5 additions and 3 deletions

View File

@ -58,10 +58,12 @@ elif [ -x "$ZUUL_CLONER" ]; then
popd
else
echo "PIP HARDCODE" > /tmp/tox_install.txt
if [ -z "$NEUTRON_PIP_LOCATION" ]; then
NEUTRON_PIP_LOCATION="git+https://git.openstack.org/openstack/neutron@$BRANCH_NAME#egg=neutron"
if [ -z "$NEUTRON_GIT_LOCATION" ]; then
NEUTRON_GIT_REPO="https://git.openstack.org/openstack/neutron"
fi
$install_cmd -U -e ${NEUTRON_PIP_LOCATION}
SRC_DIR="$VIRTUAL_ENV/src/neutron"
git clone --depth 1 --branch $BRANCH_NAME $NEUTRON_GIT_REPO $SRC_DIR
$install_cmd -U -e $SRC_DIR
fi
$install_cmd -U $*