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"
|
echo "Deploying art.shburg.org"
|
||||||
|
|
||||||
NODE_ENV=production gulp deploy
|
|
||||||
|
|
||||||
server="art.shburg.org"
|
server="art.shburg.org"
|
||||||
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 "Building..."
|
||||||
|
npm run out
|
||||||
|
NODE_ENV=production gulp deploy
|
||||||
|
|
||||||
|
echo "Packing $tarpath"
|
||||||
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=src \
|
||||||
--exclude=deploy.sh \
|
--exclude=deploy.sh \
|
||||||
--exclude=install.sh \
|
--exclude=install.sh \
|
||||||
.
|
.
|
||||||
|
|
||||||
echo "Build file: $tarpath"
|
echo "Uploading..."
|
||||||
|
|
||||||
#ssh h "rm -rf $destpath/*"
|
#ssh h "rm -rf $destpath/*"
|
||||||
ssh h "rm -rf $destpath/public/*"
|
ssh h "rm -rf $destpath/public/*"
|
||||||
scp ${tarpath} hoster@${server}:${destpath}
|
scp ${tarpath} hoster@${server}:${destpath}
|
||||||
echo "Build file successfully uploaded on server"
|
|
||||||
|
|
||||||
echo "Installing..."
|
echo "Installing..."
|
||||||
ssh hoster@${server} "bash -s" -- < ./install.sh ${destpath} ${tarfile}
|
ssh hoster@${server} "bash -s" -- < ./install.sh ${destpath} ${tarfile}
|
||||||
|
|
||||||
|
echo "Clear..."
|
||||||
rm ${tarpath}
|
rm ${tarpath}
|
||||||
|
|
||||||
echo "Done"
|
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"
|
dir_path="$1"
|
||||||
build_file="$2"
|
build_file="$2"
|
||||||
|
app="hudozka"
|
||||||
|
script="forever.json"
|
||||||
|
|
||||||
cd ${dir_path}
|
cd ${dir_path}
|
||||||
|
|
||||||
@@ -12,9 +14,9 @@ gunzip -c ${build_file} | tar xopf -
|
|||||||
npm install --production --loglevel error
|
npm install --production --loglevel error
|
||||||
|
|
||||||
#starting www
|
#starting www
|
||||||
if forever restart src/bin/www.js; then
|
if forever restart ${app}; then
|
||||||
echo www.js restarted
|
echo App restarted
|
||||||
else
|
else
|
||||||
forever start src/bin/www.js
|
forever start ${script}
|
||||||
echo www.js started
|
echo App started
|
||||||
fi
|
fi
|
||||||
Reference in new issue
Block a user