Remove $(dirname $0) from devtest.sh docs.

We have two remaining instances of $(dirname $0) that get shown to the
user in the instructions for running the devtest sub-scripts by hand.

When these commands are run inside devtest.sh, they locate the directory
that devtest.sh is in, so they serve as an fixed reference point from
which we can locate the other scripts that need to be run.

When a user runs these by hand, they don't get anything useful. The
intent here is to replace the unhelpful instructions with a useful
equivalent - something the user can actually enter that will have the
desired effect.

One of these is obsolete; by that point, $TRIPLEO_ROOT is set and in
$PATH, so we can run the script directly. I've removed the $(dirname $0)
as it isn't needed.

The one case we do have to care about the path is the initial source
devtest_variables. I can't see a way to have a single command-line that
works for both devtest.sh and the user running sub-scripts manually, so
I've manually duplicated that line in a slightly different format so
that the docs will show the user a useful line.

As a special case, add a few lines to devtest_variables.sh to handle the
case where $TRIPLEO_ROOT/tripleo-incubator/scripts does not yet exist,
usually because devtest_setup.sh has never been run in this environment
before.

This slipped through CI because devstack-gate/devstack-vm-gate-wrap.sh
pre-emptively clones all the needed repositories; so in CI,
$TRIPLEO_ROOT/tripleo-incubator/scripts *does* already exist before
devtest_setup.sh is called the first time.

Change-Id: Iba38d8df7ea1cb9a3896684bb5907d6be5649a84
This commit is contained in:
James Polley 2014-03-11 13:54:09 +11:00
parent 1ea0ca963b
commit f129fef8fa
2 changed files with 14 additions and 3 deletions

View File

@ -130,16 +130,18 @@ fi
### --include
## #. See :doc:`devtest_variables` for documentation::
## #. See :doc:`devtest_variables` for documentation. Assuming you're still at
## the root of your checkout::
source $(dirname $0)/devtest_variables.sh
## source scripts/devtest_variables.sh
source $(dirname $0)/devtest_variables.sh #nodocs
## #. See :doc:`devtest_setup` for documentation.
## $CONTINUE should be set to '--trash-my-machine' to have it execute
## unattended.
## ::
$(dirname $0)/devtest_setup.sh $CONTINUE
devtest_setup.sh $CONTINUE
## #. See :doc:`devtest_testenv` for documentation. Note that you can make
## your test environment just once and reuse it thereafter.

View File

@ -39,6 +39,15 @@ export TRIPLEO_ROOT=${TRIPLEO_ROOT:-~/.cache/tripleo} #nodocs
## - you need to add that to the PATH.
## ::
### --end
# If devtest_setup.sh has never been run in this environment,
# $TRIPLEO_ROOT/tripleo-incubator/scripts probably won't exist, so we can't
# rely on being able to run devtest_setup.sh from there
if [ ! -e $TRIPLEO_ROOT ]; then
export PATH=$(readlink -e $(dirname ${BASH_SOURCE[0]})):$PATH
fi
### --include
export PATH=$TRIPLEO_ROOT/tripleo-incubator/scripts:$PATH
## #. Set the default bare metal power manager. By default devtest uses