tripleo-incubator/scripts/devtest_end.sh
James Polley 464d7faebe Standardise location of environment password/rc files.
Discussion on https://review.openstack.org/#/c/82807 highlighted the fact
that although our scripts consistently write the environment rc files
into $TRIPLEO_ROOT/, the password files are dropped in
whatever directory the user happened to run the scripts from.

Ideally these should be collected into a heat json environment file
which heat can use directly and we can query via jq; as an intermediate
step while we sort that out, this change makes sure that they at least
get written out to $TRIPLEO_ROOT/, alongside the other artifacts we
generate during a devtest run.

write-tripleorc likewise defaulted to creating a tripleorc in whatever
location the user happened to be in at the time, so I've given it
similar treatment to standardise the location of the tripleorc file.

Along the way, stevek objected to having if/then on separate lines. As
the instances in these scripts were 2/3eds of all such occurrences in the
scripts directory, I let my preference for this style override my
preference not to make unrelated stylistic changes in the same commit as
substantive changes.

Change-Id: I30a2cc4f406122bb038d314a277c2444182bd0c9
2014-04-10 17:21:55 +10:00

37 lines
656 B
Bash
Executable File

#!/bin/bash
set -eu
set -o pipefail
### --include
## devtest_end
## ============
## #. Save your devtest environment::
## write-tripleorc --overwrite $TRIPLEO_ROOT/tripleorc
### --end
if [ -e tripleorc ]; then
echo "Resetting existing $PWD/tripleorc with new values"
tripleorc_path=$PWD/tripleorc
else
tripleorc_path=$TRIPLEO_ROOT/tripleorc
fi
write-tripleorc --overwrite $tripleorc_path
echo "devtest.sh completed."
echo source $tripleorc_path to restore all values
echo ""
### --include
## #. If you need to recover the environment, you can source tripleorc.
## ::
## source $TRIPLEO_ROOT/tripleorc
## The End!
##
### --end