Click here to load reader
Upload
martins
View
527
Download
0
Embed Size (px)
DESCRIPTION
A brief overview of bivou.ac, the sinatra app for deploying web apps
Citation preview
bivou.ac
What?–noun
1.a military encampment made with tents or improvised shelters.2.the place used for such an encampment.
-verb3.to rest or assemble in such an area; encamp.
A sinatra app for deploying rack-compliant web apps
push == deploy
How?
Don't reinvent the wheel,use existing tools:
• nginx• phusion passenger• git• sinatra
nginx/passenger configuration>sudo gem install passenger>sudo passenger-install-nginx-module
server {listen 80;server_name bivouac.com www.bivouac.com;root /home/bivouac/current/public;passenger_enabled on;
}
server {listen 80;server_name *.bivouac.com;root /home/bivouac/apps/$host/public;passenger_enabled on;
}
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
The Sinatra App
• one model – Sites• name:string• ssh_public_key:string
on Site creation
• create folder in webserver dir• git init .• create git post-receive hook• add key to authorized_keys• show git commands
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
Thanks to:
Keith PittyMike KoukoulisBen Hoskings
http://bivou.achttp://github.com/martinstannard/bivouac