deployment update
This commit is contained in:
1 parent
427de393ed
commit
8a0074cbf9
3 files changed
+23
-10
No files matched your search
@@ -2,33 +2,36 @@
|
||||
|
||||
echo "Deploying art.shburg.org"
|
||||
|
||||
NODE_ENV=production gulp deploy
|
||||
|
||||
server="art.shburg.org"
|
||||
tarfile="build.tar.gz"
|
||||
tarpath=$TMPDIR${tarfile}
|
||||
destpath="~/www/art.shburg.org"
|
||||
|
||||
echo "Packing..."
|
||||
echo "Building..."
|
||||
npm run out
|
||||
NODE_ENV=production gulp deploy
|
||||
|
||||
echo "Packing $tarpath"
|
||||
env GZIP=-9 tar -czf ${tarpath} \
|
||||
--disable-copyfile \
|
||||
--exclude=node_modules \
|
||||
--exclude=.git \
|
||||
--exclude=.idea \
|
||||
--exclude=.DS_Store \
|
||||
--exclude=src \
|
||||
--exclude=deploy.sh \
|
||||
--exclude=install.sh \
|
||||
.
|
||||
|
||||
echo "Build file: $tarpath"
|
||||
|
||||
echo "Uploading..."
|
||||
#ssh h "rm -rf $destpath/*"
|
||||
ssh h "rm -rf $destpath/public/*"
|
||||
scp ${tarpath} hoster@${server}:${destpath}
|
||||
echo "Build file successfully uploaded on server"
|
||||
|
||||
echo "Installing..."
|
||||
ssh hoster@${server} "bash -s" -- < ./install.sh ${destpath} ${tarfile}
|
||||
|
||||
echo "Clear..."
|
||||
rm ${tarpath}
|
||||
|
||||
echo "Done"
|
||||
@@ -0,0 +1,8 @@
|
||||
{
|
||||
"uid": "hudozka",
|
||||
"append": true,
|
||||
"watch": false,
|
||||
"script": "index.js",
|
||||
"sourceDir": "/home/hoster/www/art.shburg.org/out",
|
||||
"wordingDir": "/home/hoster/www/art.shburg.org"
|
||||
}
|
||||
+6
-4
@@ -2,6 +2,8 @@
|
||||
|
||||
dir_path="$1"
|
||||
build_file="$2"
|
||||
app="hudozka"
|
||||
script="forever.json"
|
||||
|
||||
cd ${dir_path}
|
||||
|
||||
@@ -12,9 +14,9 @@ gunzip -c ${build_file} | tar xopf -
|
||||
npm install --production --loglevel error
|
||||
|
||||
#starting www
|
||||
if forever restart src/bin/www.js; then
|
||||
echo www.js restarted
|
||||
if forever restart ${app}; then
|
||||
echo App restarted
|
||||
else
|
||||
forever start src/bin/www.js
|
||||
echo www.js started
|
||||
forever start ${script}
|
||||
echo App started
|
||||
fi
|
||||
Reference in new issue
Block a user