Add in-place execution mode for reproducer

Adds command line option and environment variable that allows user to
run reproducer without wiping tq[e] repositories on each run.

When specified it will just pull and rebase them when they already
exist.

This allows us to test effects of changes made to these repositories
and re-run reproducer multiple times.

Change-Id: I7b489d5fba0e1f5dd0d34fff48107440cbc93c00
This commit is contained in:
Sorin Sbarnea 2018-12-28 12:45:14 +00:00
parent 6805c3f9f4
commit 86d5cec0b9
1 changed files with 21 additions and 3 deletions

View File

@ -19,6 +19,7 @@
: ${NODES_FILE:="{{ nodes_config }}"}
: ${ZUUL_CHANGES:="{{ zuul_changes }}"}
: ${EXTRA_PARAMS:=""}
: ${IN_PLACE:=false}
SSH_OPTS="-o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null"
@ -29,6 +30,9 @@ usage () {
echo " -w, --workspace <dir>"
echo " directory where the virtualenv, inventory files, etc."
echo " are created. Defaults to creating a directory in /tmp"
echo " -i, --in-place"
echo " Avoid wiping tq[e] repositories if they already exist"
echo " and just pull --rebase them. [IN_PLACE=true]"
echo " -v, --create-virtualenv"
echo " create a virtualenv to install Ansible and dependencies."
echo " Options to pass true/false. Defaults to true for OVB. "
@ -82,6 +86,11 @@ while [ "x$1" != "x" ]; do
shift
;;
--in-place|-i)
IN_PLACE=true
shift
;;
--create-virtualenv|-v)
CREATE_VIRTUALENV=$2
shift
@ -209,11 +218,20 @@ export ZUUL_CHANGES
# Start from a clean workspace
mkdir -p $WORKSPACE
cd $WORKSPACE
rm -rf tripleo-quickstart tripleo-quickstart-extras
[ "$IN_PLACE" == "true" ] || \
rm -rf tripleo-quickstart tripleo-quickstart-extras
# Clone quickstart and quickstart-extras
git clone https://github.com/openstack/tripleo-quickstart
git clone https://github.com/openstack/tripleo-quickstart-extras
for REPO in tripleo-quickstart tripleo-quickstart-extras
do
if [ -d "$REPO" ]; then
pushd $REPO
git pull --rebase
popd
else
git clone https://github.com/openstack/$REPO
fi
done
# Set up a virtual env if requested
if [ "$CREATE_VIRTUALENV" = "true" ]; then