auser (owner)

Revisions

gist: 95562 Download_button fork
public
Public Clone URL: git://gist.github.com/95562.git
Embed All Files: show embed
chef_recipe.rb #
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
include_recipe "sqlite"
 
node[:rails][:version] = "2.3.2"
include_recipe "rails"
 
gem_package "rake" do
  version "0.8.4"
end
 
execute "migrate-paparazzi" do
  command "cd /var/www/paparazzi && RAILS_ENV=production rake db:migrate 2>/dev/null && touch tmp/restart.txt"
  action :nothing
end
 
include_recipe "nginx"
 
template "#{node[:nginx_dir]}/sites-available/paparazzi" do
  source "paparazzi.nginx.erb"
  owner "root"
  group "root"
  mode 0644
  
  notifies :run, resources(:execute => "migrate-paparazzi")
end
 
nginx_site "paparazzi"
paparazzi.nginx.erb #
1
2
3
4
5
6
7
8
9
10
11
12
server {
  listen 80;
  server_name paparazzi.com www.paparazzi.com;
 
  access_log <%= @node[:nginx_log_dir] %>/paparazzi.access.log;
 
  location / {
    root /var/www/paparazzi/public;
    index index.html index.htm;
  }
}
 
sample-nginx-app.rb #
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
pool :application do
  instances 1..3
  keypair "auser-work"
  ami 'ami-7cfd1a15'
  
  cloud :nginx do
    has_directory "/var/www"
    has_directory "/var/www/default"
    disable :haproxy
    
    has_git_repos "paparazzi" do
      at "/var/www"
      source "git://github.com/auser/paparazzi.git"
      owner "www-data"
    end
    
    chef do
      include_recipes "~/.poolparty/chef/cookbooks/*"
      
      recipe "/Users/alerner/.poolparty/chef_recipe.rb"
      templates "/Users/alerner/.poolparty/templates/"
    end
    
  end
 
end