Skip to content

Instantly share code, notes, and snippets.

@auser
Created November 14, 2008 21:10
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 3 You must be signed in to fork a gist
  • Save auser/25097 to your computer and use it in GitHub Desktop.
Save auser/25097 to your computer and use it in GitHub Desktop.
Sample PoolParty rails spec
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
<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>
# 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment