big update for deployment system
This commit is contained in:
1 parent
2c443568e8
commit
d3c7e444ea
2 files changed
+26
-12
No files matched your search
@@ -1,10 +1,16 @@
|
||||
#!/bin/sh
|
||||
|
||||
echo "Deploying art.shburg.org"
|
||||
|
||||
NODE_ENV=production gulp
|
||||
|
||||
tarfile=build.tar.gz
|
||||
server="art.shburg.org"
|
||||
app_port=1800
|
||||
tarfile="build.tar.gz"
|
||||
tarpath=$TMPDIR$tarfile
|
||||
destpath="~/www/art.shburg.org"
|
||||
|
||||
echo "Packing..."
|
||||
env GZIP=-9 tar -czf $tarpath \
|
||||
--disable-copyfile \
|
||||
--exclude=node_modules \
|
||||
@@ -14,11 +20,14 @@ env GZIP=-9 tar -czf $tarpath \
|
||||
--exclude=deploy.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
|
||||
echo "art.shlisselburg.org deployment completed successfully"
|
||||
echo "Done"
|
||||
+10
-5
@@ -1,14 +1,19 @@
|
||||
#!/bin/sh
|
||||
|
||||
gunzip build.tar.gz
|
||||
tar xf build.tar -C ~/art
|
||||
rm build.tar
|
||||
dir_path="$1"
|
||||
build_file="$2"
|
||||
port="$3"
|
||||
|
||||
cd $dir_path
|
||||
|
||||
gunzip -c $build_file | tar xopf -
|
||||
|
||||
#rm build.tar
|
||||
|
||||
cd ~/art
|
||||
npm install --production --loglevel error
|
||||
|
||||
export NODE_ENV=production
|
||||
export PORT=18010
|
||||
export PORT=$port
|
||||
|
||||
#starting www
|
||||
if forever restart bin/www.js; then
|
||||
|
||||
Reference in new issue
Block a user