Created
March 26, 2012 21:47
-
-
Save tlack/2209996 to your computer and use it in GitHub Desktop.
Idea for auto-deployment system for vhosted node.js apps
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
for DIR in /home/*/node; do | |
PORT=[generate port based on crc32 of $DIR] | |
# somehow check if not running | |
NODE_ENV=dev NODE_PORT=$PORT node-dev $DIR/app.js | |
cat /etc/nginx/configs.avail/default-node.conf | \ | |
sed -e s/DIR/$DIR/ | \ | |
sed -e s/PORT/$PORT > /etc/nginx/configs.enabled/node-$DIR.conf | |
# somehow check if we actually created/changed a config here | |
if [ $changed -eq 1 ]; then | |
service nginx restart | |
fi | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment