Skip to content

Instantly share code, notes, and snippets.

@fairchild
Forked from auser/paparazzi.conf.erb
Created April 14, 2009 23:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save fairchild/95499 to your computer and use it in GitHub Desktop.
Save fairchild/95499 to your computer and use it in GitHub Desktop.
# Basic pool spec
# Shows global settings for the clouds
pool :party do
# instances 1..3
# set_master_ip_to '174.129.221.207'
keypair "#{ENV["HOME"]}/.poolparty/pool_dsa_key"
verbose true
# ami 'ami-7cfd1a15'
# using :vmrun
cloud :rails do
enable :tokyo_tyrant
has_file :name => "/etc/motd", :content => "Welcome to your PoolParty instance"
has_directory "/var/www"
has_package :name => 'nmap'
has_package :name => 'irb'
has_variable "name", :value => "Michael"
has_file :name => "/var/www/index.html" do
content "<h1>Welcome to your new poolparty instance <%= @node[:poolparty][:name] %>"
mode 0644
end
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 "~/.poolparty/rails_chef_recipe.rb"
templates "~/.poolparty/templates/"
end
end
end
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment