hacking/integration-test/test.sh
Ian Wienand 93cdb6f557 Replace openstack.org git:// URLs with https://
This is a mechanically generated change to replace openstack.org
git:// URLs with https:// equivalents.

This is in aid of a planned future move of the git hosting
infrastructure to a self-hosted instance of gitea (https://gitea.io),
which does not support the git wire protocol at this stage.

This update should result in no functional change.

For more information see the thread at

 http://lists.openstack.org/pipermail/openstack-discuss/2019-March/003825.html

Change-Id: I88f279ebe4aef832073cfe747e65037f1dcf0c81
2019-03-24 20:33:44 +00:00

59 lines
1.1 KiB
Bash
Executable File

#!/bin/bash
# Usage: test.sh openstack keystone path-to-repo
# path-to-repo is an optional parameter, if it exists
# no cloning will happen and the local directory will be used,
# the first two parameter get ignored.
# Note: you can clone from a local file with REPO_ROOT=file:////~/path/to/repo
set -x
set -e
REPO_ROOT=${REPO_ROOT:-https://git.openstack.org}
HACKING="$(pwd)"
if [[ $# -lt 2 ]] ; then
echo "Script needs at least two arguments:"
echo "$0 organization name [path-to-repo]"
exit 1
fi
org=$1
project=$2
if [[ $# -eq 3 ]] ; then
projectdir=$3
clone=0
else
projectdir=$project
clone=1
fi
if [ "$clone" = "1" ] ; then
tempdir="$(mktemp -d)"
trap "rm -rf $tempdir" EXIT
pushd $tempdir
git clone $REPO_ROOT/$org/$project --depth=1
fi
pushd $projectdir
set +e
# Install project with test-requirements so that hacking's
# local-check-factory works
pip install -r test-requirements.txt
pip install .
# Reinstall hacking, the above might have uninstalled it
pip install $HACKING
flake8 --select H --statistics
RET=$?
popd
if [ "$clone" = "1" ] ; then
popd
fi
exit $RET