9

Click here to load reader

bivou.ac

  • 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

Page 1: bivou.ac

bivou.ac

[email protected]

Page 2: 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

Page 3: bivou.ac

How?

Don't reinvent the wheel,use existing tools:

• nginx• phusion passenger• git• sinatra

Page 4: bivou.ac

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;

}

Page 5: bivou.ac

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

Page 6: bivou.ac

The Sinatra App

• one model – Sites• name:string• ssh_public_key:string

Page 7: bivou.ac

on Site creation

• create folder in webserver dir• git init .• create git post-receive hook• add key to authorized_keys• show git commands

Page 8: bivou.ac

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

Page 9: bivou.ac

Thanks to:

Keith PittyMike KoukoulisBen Hoskings

http://bivou.achttp://github.com/martinstannard/bivouac