diff options
author | 2015-05-19 10:14:43 +0200 | |
---|---|---|
committer | 2015-05-19 10:55:02 +0200 | |
commit | 14674941d0e504a942886d36749a0f64490e4ade (patch) | |
tree | 2d5268a69f1d329c31afb84f8263959851802b90 /fuel/prototypes/auto-deploy/deploy/deploy.sh | |
parent | d3995f1df04dc64aba37d70309899f556982aac1 (diff) |
Deployment corrections for Fuel
The most important change is the introduction of support for a selectable
temporary directory for ISO manipulations by setting the TMPDIR variable.
Invoke deploy.sh as "sudo TMPDIR=/my/tmp/dir ./deploy.sh ..." to make
use of this, otherwise the temporary directory defaults to that of the
user running the script.
Other improvements:
- Added error check for when the patch-iso.sh gets an error from
copying data with cpio (potentially indicating out of disk space)
- Corrected typo in deploy.sh: error-exit -> error_exit
JIRA
Change-Id: I74966c3fe2bee0ac1923cfa9bd9ebfe1ca73a9da
Signed-off-by: Stefan K. Berg <stefan.k.berg@ericsson.com>
Diffstat (limited to 'fuel/prototypes/auto-deploy/deploy/deploy.sh')
-rwxr-xr-x | fuel/prototypes/auto-deploy/deploy/deploy.sh | 23 |
1 files changed, 19 insertions, 4 deletions
diff --git a/fuel/prototypes/auto-deploy/deploy/deploy.sh b/fuel/prototypes/auto-deploy/deploy/deploy.sh index 938efb6..f5aa634 100755 --- a/fuel/prototypes/auto-deploy/deploy/deploy.sh +++ b/fuel/prototypes/auto-deploy/deploy/deploy.sh @@ -13,7 +13,6 @@ topdir=$(dirname $(readlink -f $BASH_SOURCE)) exampledir=$(cd $topdir/../examples; pwd) functions=${topdir}/functions -tmpdir=$HOME/fueltmp # Define common functions . ${functions}/common.sh @@ -61,7 +60,23 @@ if [ $# -ne 3 ]; then exit 1 fi -# Setup tmpdir +# Setup tmpdir - if TMPDIR env variable is set, use that one +# else create in $HOME/fueltmp +if [ -n "${TMPDIR}" ]; then + if [ -d ${TMPDIR} ]; then + tmpdir=${TMPDIR}/fueltmp + echo "Using TMPDIR=${TMPDIR}, so tmpdir=${tmpdir}" + else + error_exit "No such directory for TMPDIR: ${TMPDIR}" + fi +else + tmpdir=${HOME}/fueltmp + echo "Default: tmpdir=$tmpdir" +fi + +# Umask must be changed so files created are readable by qemu +umask 0022 + if [ -d $tmpdir ]; then rm -Rf $tmpdir || error_exit "Could not remove tmpdir $tmpdir" fi @@ -74,9 +89,9 @@ dhafile=$(cd `dirname $3`; echo `pwd`/`basename $3`) if [ ! -f $isofile ]; then error_exit "Could not find ISO file $isofile" elif [ ! -f $deafile ]; then - error-exit "Could not find DEA file $deafile" + error_exit "Could not find DEA file $deafile" elif [ ! -f $dhafile ]; then - error-exit "Could not find DHA file $dhafile" + error_exit "Could not find DHA file $dhafile" fi # Connect adapter |