big update for deployment system

This commit is contained in:
tmshv committed 2016-01-05 00:48:49 +03:00
1 parent 2c443568e8
commit d3c7e444ea
2 files changed
+26 -12

No files matched your search

+16 -7
View File
@@ -1,10 +1,16 @@
#!/bin/sh #!/bin/sh
echo "Deploying art.shburg.org"
NODE_ENV=production gulp NODE_ENV=production gulp
tarfile=build.tar.gz 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 \ --disable-copyfile \
--exclude=node_modules \ --exclude=node_modules \
@@ -14,11 +20,14 @@ env GZIP=-9 tar -czf $tarpath \
--exclude=deploy.sh \ --exclude=deploy.sh \
--exclude=install.sh . --exclude=install.sh .
echo "build file: $tarpath" echo "Build file: $tarpath"
ssh hoster.et "rm -rf $destpath/*"
scp $tarpath hoster@$server:$destpath
echo "Build file successfully uploaded on server"
echo "Installing..."
ssh hoster.et "bash -s" -- < ./install.sh $destpath $tarfile $app_port
ssh shburg.et "rm -rf art/*"
scp $tarpath shburg@146.185.183.243:~
scp install.sh shburg@146.185.183.243:~
ssh shburg.et "./install.sh"
rm $tarpath rm $tarpath
echo "art.shlisselburg.org deployment completed successfully" echo "Done"
+10 -5
View File
@@ -1,14 +1,19 @@
#!/bin/sh #!/bin/sh
gunzip build.tar.gz dir_path="$1"
tar xf build.tar -C ~/art build_file="$2"
rm build.tar port="$3"
cd $dir_path
gunzip -c $build_file | tar xopf -
#rm build.tar
cd ~/art
npm install --production --loglevel error npm install --production --loglevel error
export NODE_ENV=production export NODE_ENV=production
export PORT=18010 export PORT=$port
#starting www #starting www
if forever restart bin/www.js; then if forever restart bin/www.js; then