X-Git-Url: https://gerrit.opnfv.org/gerrit/gitweb?a=blobdiff_plain;f=fuel%2Fprototypes%2Fauto-deploy%2Fdeploy%2Fdeploy.sh;h=f5aa634f96c372251302d35551f6c132605be6e4;hb=563547b4a9f44090f32c0e17d040114854563760;hp=938efb62ffe2c3bb071d5b7847b63dd2e5cc9878;hpb=129ffe434c010508f26416983835e80dec0cc1d8;p=genesis.git 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