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"
|
||||
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"
|
||||
+5
-5
@@ -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
|
||||
Reference in new issue
Block a user