2. What?
–noun
1.a military encampment made with tents or improvised shelters.
2.the place used for such an encampment.
-verb
3.to rest or assemble in such an area; encamp.
A sinatra app for deploying
rack-compliant web apps
push == deploy
3. How?
Don't reinvent the wheel,
use existing tools:
• nginx
• phusion passenger
• git
• sinatra
5. git
• how we get our code on the server
• hooks for restarting the site
Look in .git/hooks/ for samples
We use the post-receive hook
6. The Sinatra App
• one model – Sites
• name:string
• ssh_public_key:string
7. on Site creation
• create folder in webserver dir
• git init .
• create git post-receive hook
• add key to authorized_keys
• show git commands
8. post-receive hook
cd #{site.directory} && git --git-dir=`pwd`/.git reset –hard;
# Matches the working tree and index to that
of the tree being switched to (defaults to HEAD).
touch #{site.directory}/tmp/restart.txt
# tells passenger to restart the site