deploy/install scripts update
This commit is contained in:
1 parent
ba6ab4a4e3
commit
45dd6f87f9
2 files changed
+12
-11
No files matched your search
@@ -7,27 +7,28 @@ NODE_ENV=production gulp
|
|||||||
server="art.shburg.org"
|
server="art.shburg.org"
|
||||||
app_port=1800
|
app_port=1800
|
||||||
tarfile="build.tar.gz"
|
tarfile="build.tar.gz"
|
||||||
tarpath=$TMPDIR$tarfile
|
tarpath=$TMPDIR${tarfile}
|
||||||
destpath="~/www/art.shburg.org"
|
destpath="~/www/art.shburg.org"
|
||||||
|
|
||||||
echo "Packing..."
|
echo "Packing..."
|
||||||
env GZIP=-9 tar -czf $tarpath \
|
env GZIP=-9 tar -czf ${tarpath} \
|
||||||
--disable-copyfile \
|
--disable-copyfile \
|
||||||
--exclude=node_modules \
|
--exclude=node_modules \
|
||||||
--exclude=.git \
|
--exclude=.git \
|
||||||
--exclude=.idea \
|
--exclude=.idea \
|
||||||
--exclude=.DS_Store \
|
--exclude=.DS_Store \
|
||||||
--exclude=deploy.sh \
|
--exclude=deploy.sh \
|
||||||
--exclude=install.sh .
|
--exclude=install.sh \
|
||||||
|
.
|
||||||
|
|
||||||
echo "Build file: $tarpath"
|
echo "Build file: $tarpath"
|
||||||
|
|
||||||
ssh h "rm -rf $destpath/*"
|
ssh h "rm -rf $destpath/*"
|
||||||
scp $tarpath hoster@$server:$destpath
|
scp ${tarpath} hoster@${server}:${destpath}
|
||||||
echo "Build file successfully uploaded on server"
|
echo "Build file successfully uploaded on server"
|
||||||
|
|
||||||
echo "Installing..."
|
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"
|
echo "Done"
|
||||||
+5
-5
@@ -4,21 +4,21 @@ dir_path="$1"
|
|||||||
build_file="$2"
|
build_file="$2"
|
||||||
port="$3"
|
port="$3"
|
||||||
|
|
||||||
cd $dir_path
|
cd ${dir_path}
|
||||||
|
|
||||||
gunzip -c $build_file | tar xopf -
|
gunzip -c ${build_file} | tar xopf -
|
||||||
|
|
||||||
#rm build.tar
|
#rm build.tar
|
||||||
|
|
||||||
npm install --production --loglevel error
|
npm install --production --loglevel error
|
||||||
|
|
||||||
export NODE_ENV=production
|
export NODE_ENV=production
|
||||||
export PORT=$port
|
export PORT=${port}
|
||||||
|
|
||||||
#starting www
|
#starting www
|
||||||
if forever restart bin/www.js; then
|
if forever restart src/bin/www.js; then
|
||||||
echo www.js restarted
|
echo www.js restarted
|
||||||
else
|
else
|
||||||
forever start bin/www.js
|
forever start src/bin/www.js
|
||||||
echo www.js started
|
echo www.js started
|
||||||
fi
|
fi
|
||||||
Reference in new issue
Block a user