0
+require 'mongrel_cluster/recipes'
0
+########################################################################
0
+# Rails Boxcar - Capistrano Deployment Recipe
0
+########################################################################
0
+# What is the name of your application? (no spaces)
0
+# set :application_name, 'my_cool_app'
0
+set :application_name, 'rubyurl'
0
+set :domain_names, 'rubyurl.com'
0
+# What is the hostname of your Rails Boxcar server?
0
+# set :boxcar_server, 'rc1.railsboxcar.com'
0
+set :boxcar_server, '198.145.115.75'
0
+# What is the username of your Rails Boxcar user that you want
0
+# to deploy this application with?
0
+# set :boxcar_username = 'johnny'
0
+set :boxcar_username, 'rubyurl'
0
+# Where is your source code repository?
0
+# set :repository = 'http://svn.railsboxcar.com/my_cool_app/tags/CURRENT'
0
+set :repository, 'https://svn.roundhaus.com/planetargon/rubyurl_2-0/trunk'
0
+set :checkout, 'export'
0
+# What database server are you using?
0
+set :database_adapter, 'postgresql'
0
+set :database_name, { :development => 'rubyurl_development',
0
+ :test => 'rubyurl_test',
0
+ :production => 'rubyurl_production' }
0
+# What port number is your database running on?
0
+set :database_port, 5432
0
+# What port number should your mongrel cluster start on?
0
+set :mongrel_port, 8000
0
+# How many instances of mongrel should be in your cluster?
0
+set :mongrel_servers, 3
0
+########################################################################
0
+# Advanced Configuration
0
+########################################################################
0
+role :web, boxcar_server
0
+role :app, boxcar_server
0
+role :db, boxcar_server, :primary => true
0
+set :user, boxcar_username
0
+set :db_development,database_name[:development]
0
+set :db_test, database_name[:test]
0
+set :db_production, database_name[:production]
0
+set :home, "/home/#{user}"
0
+set :etc, "#{home}/etc"
0
+set :log, "#{home}/log"
0
+set :deploy_to, "#{home}/sites/#{application_name}"
0
+set :mongrel_conf, "#{etc}/mongrel_cluster.#{application_name}.conf"
0
+set :mongrel_pid, "#{log}/mongrel_cluster.#{application_name}.pid"
0
+set :mongrel_address, '127.0.0.1'
0
+set :mongrel_environment, :production
0
+desc "Create database.yml in shared/config"
0
+ database_configuration = render :template => <<-EOF
0
+ adapter: <%= database_adapter %>
0
+ port: <%= database_port %>
0
+ database: <%= db_development %>
0
+ database: <%= db_test %>
0
+ database: <%= db_production %>
0
+ mongrel_cluster_configuration = render :template => <<-EOF
0
+port: <%= mongrel_port %>
0
+pid_file: <%= mongrel_pid %>
0
+servers: <%= mongrel_servers %>
0
+cwd: <%= deploy_to %>/current
0
+environment: production
0
+ nginx_generator_configuration = render :template => <<-EOF
0
+ #######################################################################
0
+ # Add the following to /etc/nginx/nginx.yml
0
+ # Then: cd /etc/nginx; generate_nginx_config nginx.yml nginx.conf
0
+ #######################################################################
0
+ <%= application_name %>:
0
+ # The upstream servers to proxy balance.
0
+ upstream:<% mongrel_servers.to_i.times do |port| %>
0
+ - 127.0.0.1:<%= mongrel_port + port %><% end %>
0
+ # Just a string of server names.
0
+ server_name: <%= domain_names %>
0
+ root: <%= deploy_to %>/current/public
0
+ #######################################################################
0
+ run "mkdir -p #{deploy_to}/shared/config"
0
+ # Create the database.yml file
0
+ put database_configuration, "#{deploy_to}/#{shared_dir}/config/database.yml"
0
+ # Create mongrel cluster configuration
0
+ put mongrel_cluster_configuration, mongrel_conf
0
+ # Print the nginx configuration information for the person deploying.
0
+ puts nginx_generator_configuration
0
+desc "Link in the production database.yml"
0
+task :after_update_code do
0
+ run "ln -nfs #{deploy_to}/#{shared_dir}/config/database.yml #{release_path}/config/database.yml"
0
\ No newline at end of file
Comments
No one has commented yet.