Created
May 18, 2015 08:41
-
-
Save hassansin/9f632c50221aa6ccf726 to your computer and use it in GitHub Desktop.
Deploy Node app with bash
This file contains hidden or 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/env sh | |
USER=ubuntu | |
SERVER=example.com | |
DESTINATION=/var/www/ics-feed | |
git archive -o latest.zip HEAD | |
scp latest.zip $USER@$SERVER:$DESTINATION | |
ssh $USER@$SERVER " \ | |
mkdir -vp $DESTINATION && cd $DESTINATION \ | |
&& unzip -o latest.zip -d ./ \ | |
&& npm install\ | |
&& sudo PORT=80 pm2 restart bin/www --name app-name\ | |
" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment