auser (owner)

Forks

Revisions

  • 92fa45 auser Tue Apr 14 19:28:00 -0700 2009
  • 45c910 auser Mon Apr 13 22:03:37 -0700 2009
  • 266828 auser Thu Nov 20 15:52:33 -0800 2008
  • 29026d auser Fri Nov 14 13:18:34 -0800 2008
  • 7fa3b7 auser Fri Nov 14 13:14:01 -0800 2008
  • 7fedc6 auser Fri Nov 14 13:13:52 -0800 2008
  • 3d7b78 auser Fri Nov 14 13:10:23 -0800 2008
gist: 25097 Download_button fork
public
Description:
Sample PoolParty rails spec
Public Clone URL: git://gist.github.com/25097.git
Embed All Files: show embed
paparazzi.conf.erb #
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
<VirtualHost *:8080>
  ServerName <%= @params[:server_name] %>
  ServerAlias <% @params[:server_aliases].each do |a| %><%= "#{a}" %> <% end %>
  DocumentRoot <%= @params[:docroot] %>
 
  RailsBaseURI /
  RailsEnv <%= @params[:rails_env] %>
  RailsAllowModRewrite on
  PassengerMaxPoolSize <%= @node[:rails][:max_pool_size] %>
 
  <Directory <%= @params[:docroot] %>>
    Options FollowSymLinks
    AllowOverride None
    Order allow,deny
    Allow from all
  </Directory>
 
  LogLevel info
  ErrorLog <%= @node[:apache][:log_dir] %>/<%= @params[:name] %>-error.log
  CustomLog <%= @node[:apache][:log_dir] %>/<%= @params[:name] %>-access.log combined
</VirtualHost>
sample_rails_spec.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
27
28
29
30
31
32
33
34
35
# Basic pool spec
# Shows global settings for the clouds
pool :application do
  instances 2..3
  keypair "auser-work"
  ami 'ami-7cfd1a15'
  
  cloud :pp1 do
    has_directory "/var/www"
    
    has_file "/etc/motd", :content => "Hi hi"
    
    has_variable "name", :value => "Ari"
    
    has_file :name => "/var/www/index.html" do
      content "<h1>Welcome to your new poolparty instance <%= @node[:poolparty][:name] %>"
      mode 0644
    end
    
    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
Ruby #
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
27
28
include_recipe "apache2"
include_recipe "passenger"
include_recipe "sqlite"
 
node[:rails][:version] = "2.3.2"
include_recipe "rails"
gem_package "sqlite3-ruby"
gem_package "rake" do
  version "0.8.4"
end
 
execute "migrate-paparazzi" do
  command "cd /var/www/paparazzi && RAILS_ENV=production rake db:migrate && touch tmp/restart.txt"
  action :nothing
end
 
web_app "paparazzi" do
  docroot "/var/www/paparazzi/public"
  template "paparazzi.conf.erb"
  server_name "www.paparazzi.com"
  server_aliases [node[:hostname], node[:fqdn], "paparazzi.com"]
  rails_env "production"
end
 
execute "rails-deployments" do
  command "echo 'running rails deployments'"
  notifies :run, resources(:execute => "migrate-paparazzi")
end