
Shallow cloning ends up writing a temporary file in the source git repo, but we may not have write access to it. So if the REPO_ROOT format is file based do a full clone. Change-Id: Ic03af1e55b41a97790de478563100247c37065ab
26 lines
490 B
Bash
Executable File
26 lines
490 B
Bash
Executable File
#!/bin/bash
|
|
|
|
# Usage: test.sh openstack keystone
|
|
# Note: you can clone from a local file with REPO_ROOT=file:////~/path/to/repo
|
|
set -x
|
|
set -e
|
|
REPO_ROOT=${REPO_ROOT:-git://git.openstack.org}
|
|
if [[ -z "$2" ]]; then
|
|
org=openstack
|
|
project=nova
|
|
else
|
|
org=$1
|
|
project=$2
|
|
fi
|
|
|
|
if [[ $REPO_ROOT == file://* ]]; then
|
|
git clone $REPO_ROOT/$org/$project
|
|
else
|
|
git clone $REPO_ROOT/$org/$project --depth=1
|
|
fi
|
|
cd $project
|
|
set +e
|
|
flake8 --select H --statistics
|
|
cd ..
|
|
rm -rf $project
|