Created
February 20, 2015 15:53
-
-
Save beshur/0bf7c7fcf79b91495ef0 to your computer and use it in GitHub Desktop.
Deployment script
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
cd .. | |
grunt release | |
cd build | |
echo "compressing..." | |
tar -cf portal.tgz ../* --exclude=../node_modules --exclude=../tests/node_modules --exclude=../data --exclude=../config/local.json | |
echo "deploying to server" | |
scp -r portal.tgz root@server:/root/remote-folder/ | |
echo "updating sources" | |
ssh root@server " | |
cd /root/remote-folder/; | |
ls | egrep -v '^(public|portal.tgz|node_modules)$'| xargs rm -rf | |
tar -xf portal.tgz; | |
npm install; | |
killall xProcessName; | |
rm -r portal.tgz; | |
rm -r build" | |
echo "restarting server..." | |
rm portal.tgz | |
echo "done!" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment