From 45dd6f87f9b592da86ab4686c10d9e7687dd6f58 Mon Sep 17 00:00:00 2001 From: Roman Timashev Date: Fri, 18 Mar 2016 01:26:53 +0300 Subject: [PATCH] deploy/install scripts update --- deploy.sh | 13 +++++++------ install.sh | 10 +++++----- 2 files changed, 12 insertions(+), 11 deletions(-) diff --git a/deploy.sh b/deploy.sh index 54e101bf..5788d863 100755 --- a/deploy.sh +++ b/deploy.sh @@ -7,27 +7,28 @@ NODE_ENV=production gulp server="art.shburg.org" app_port=1800 tarfile="build.tar.gz" -tarpath=$TMPDIR$tarfile +tarpath=$TMPDIR${tarfile} destpath="~/www/art.shburg.org" echo "Packing..." -env GZIP=-9 tar -czf $tarpath \ +env GZIP=-9 tar -czf ${tarpath} \ --disable-copyfile \ --exclude=node_modules \ --exclude=.git \ --exclude=.idea \ --exclude=.DS_Store \ --exclude=deploy.sh \ - --exclude=install.sh . + --exclude=install.sh \ + . echo "Build file: $tarpath" ssh h "rm -rf $destpath/*" -scp $tarpath hoster@$server:$destpath +scp ${tarpath} hoster@${server}:${destpath} echo "Build file successfully uploaded on server" echo "Installing..." -ssh hoster@$server "bash -s" -- < ./install.sh $destpath $tarfile $app_port +ssh hoster@${server} "bash -s" -- < ./install.sh ${destpath} ${tarfile} ${app_port} -rm $tarpath +rm ${tarpath} echo "Done" diff --git a/install.sh b/install.sh index 2f6285f3..53a3071e 100755 --- a/install.sh +++ b/install.sh @@ -4,21 +4,21 @@ dir_path="$1" build_file="$2" port="$3" -cd $dir_path +cd ${dir_path} -gunzip -c $build_file | tar xopf - +gunzip -c ${build_file} | tar xopf - #rm build.tar npm install --production --loglevel error export NODE_ENV=production -export PORT=$port +export PORT=${port} #starting www -if forever restart bin/www.js; then +if forever restart src/bin/www.js; then echo www.js restarted else - forever start bin/www.js + forever start src/bin/www.js echo www.js started fi