Skip to content

Instantly share code, notes, and snippets.

@beshur
Created February 20, 2015 15:53
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save beshur/0bf7c7fcf79b91495ef0 to your computer and use it in GitHub Desktop.
Save beshur/0bf7c7fcf79b91495ef0 to your computer and use it in GitHub Desktop.
Deployment script
#!/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