diff --git a/roles/create-reproducer-script/templates/reproducer-quickstart.sh.j2 b/roles/create-reproducer-script/templates/reproducer-quickstart.sh.j2 index 62bfb2a8d..a069462ef 100644 --- a/roles/create-reproducer-script/templates/reproducer-quickstart.sh.j2 +++ b/roles/create-reproducer-script/templates/reproducer-quickstart.sh.j2 @@ -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 " 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