<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array">
    <added>
      <filename>Capfile</filename>
    </added>
  </added>
  <modified type="array">
    <modified>
      <diff>@@ -1,4 +1,7 @@
-require 'mongrel_cluster/recipes'
+# Required for using Mongrel with Capistrano2
+#   gem install palmtree
+require 'palmtree/recipes/mongrel_cluster'
+require 'highline/import'
 
 ########################################################################
 # Rails Boxcar - Capistrano Deployment Recipe
@@ -7,9 +10,7 @@ require 'mongrel_cluster/recipes'
 # What is the name of your application? (no spaces)
 # Example: 
 #   set :application_name, 'my_cool_app'
-set :application_name, 'rubyurl'
-
-set :domain_names, 'rubyurl.com'
+set :application_name, 'my_cool_app'
 
 # What is the hostname of your Rails Boxcar server?
 # Example: 
@@ -19,33 +20,36 @@ set :boxcar_server, '198.145.115.75'
 # What is the username of your Rails Boxcar user that you want
 # to deploy this application with?
 # Example:
-#   set :boxcar_username = 'johnny'
+#   set :boxcar_username, 'johnny'
 set :boxcar_username, 'rubyurl'
 
 # Where is your source code repository?
 # Example:
 #   set :repository = 'http://svn.railsboxcar.com/my_cool_app/tags/CURRENT'
-set :repository, 'https://svn.roundhaus.com/planetargon/rubyurl_2-0/trunk'
-set :checkout,   'export'
+set :svn_username, 'rubyurl'
+set :svn_repository_url, 'https://svn.roundhaus.com/planetargon/rubyurl_2-0/trunk'
 
 # What database server are you using?
 # Example:
-set :database_adapter, 'postgresql'
 set :database_name, { :development  =&gt; 'rubyurl_development',
                       :test         =&gt; 'rubyurl_test',
                       :production   =&gt; 'rubyurl_production' }
 
-# What port number is your database running on?
-set :database_port, 5432
 
-# What port number should your mongrel cluster start on?
-set :mongrel_port, 8000
 
-# How many instances of mongrel should be in your cluster?
-set :mongrel_servers, 3
+
+
+
+
+
+
+
+
+
 
 ######################################################################## 
 # Advanced Configuration
+# Only the courageous of ninjas dare pass this! 
 ######################################################################## 
 
 role :web, boxcar_server
@@ -57,83 +61,170 @@ set :user, boxcar_username
 set :use_sudo, false
 
 
+set :domain_names, Proc.new { HighLine.ask(&quot;What is the primary domain name?&quot;) { |q| q.default = &quot;railsboxcar.com&quot; } }
+
+
+# subversion / SCM
+# Ask the user for their subversion password
+set :svn_password, Proc.new { HighLine.ask(&quot;What is your subversion password for #{svn_username}: &quot;) { |q| q.echo = &quot;x&quot; } }
+set :repository, Proc.new { &quot;--username #{svn_username} &quot; + &quot;--password #{svn_password} &quot; + &quot;#{svn_repository_url}&quot; }
+set :checkout,   'export'
+
 set :db_development,database_name[:development]
 set :db_test, database_name[:test]
 set :db_production, database_name[:production]
 
+# Prompt user to set database user/pass
+set :database_username, Proc.new { HighLine.ask(&quot;What is your database username?  &quot;) { |q| q.default = &quot;dbuser&quot; } }
+set :database_host, Proc.new { HighLine.ask(&quot;What host is your database running on?  &quot;) { |q| q.default = &quot;localhost&quot; } }
+set :database_adapter, Proc.new { 
+  choose do |menu|
+    menu.prompt = &quot;What database server will you be using?&quot;
+    menu.choices(:postgresql, :mysql) 
+  end
+}
+set :database_password, Proc.new { HighLine.ask(&quot;What is your database user's password?  &quot;) { |q| q.echo = &quot;x&quot; } }
+set :database_socket, Proc.new { HighLine.ask(&quot;Where is the MySQL socket file?  &quot;) { |q| q.default = &quot;/var/run/mysqld/mysqld.sock&quot; } }
+set :database_port, Proc.new { 
+  HighLine.ask(&quot;What port does your database run on?  &quot;) do |q| 
+    if database_adapter.to_s == &quot;postgresql&quot;
+      q.default = &quot;5432&quot; 
+    else
+      q.default = &quot;3306&quot; 
+    end
+  end
+}
+
 # directories
 set :home, &quot;/home/#{user}&quot;
 set :etc, &quot;#{home}/etc&quot;
 set :log, &quot;#{home}/log&quot;
 set :deploy_to, &quot;#{home}/sites/#{application_name}&quot;
 
+set :shared_dir, &quot;#{deploy_to}/shared&quot;
+
 # mongrel
+# What port number should your mongrel cluster start on?
+set :mongrel_port, Proc.new { HighLine.ask(&quot;What port will your mongrel cluster start with?  &quot;) { |q| q.default = &quot;8000&quot; } }
+
+# How many instances of mongrel should be in your cluster?
+set :mongrel_servers, Proc.new { 
+ choose do |menu|
+    menu.prompt = &quot;How many mongrel servers should run?&quot;
+    menu.choices(1,2,3)
+  end
+}
+
 set :mongrel_conf, &quot;#{etc}/mongrel_cluster.#{application_name}.conf&quot; 
 set :mongrel_pid, &quot;#{log}/mongrel_cluster.#{application_name}.pid&quot; 
 set :mongrel_address, '127.0.0.1'
 set :mongrel_environment, :production
 
+
 # database.yml
 desc &quot;Create database.yml in shared/config&quot; 
 task :after_setup do
-  database_configuration = render :template =&gt; &lt;&lt;-EOF
+  puts &quot;###########################################&quot;
+  puts &quot; Rails Boxcar - setup process&quot;
+  puts &quot;###########################################&quot;
+  puts &quot;# STEP 1: Database Configuration&quot;
+  puts &quot;###########################################&quot; 
+
+
+  today = Time.now.strftime('%b %d, %Y')
+
+  yml_comment = &lt;&lt;EOF
+#
+# Generated on #{today} for Rails Boxcar (http://railsboxcar.com)
+# 
+EOF
+
+  case database_adapter.to_s
+    when &quot;postgresql&quot;
+      database_configuration = &lt;&lt;EOF
+#{yml_comment}      
 login: &amp;login
-  adapter: &lt;%= database_adapter %&gt;
-  host: localhost
-  port: &lt;%= database_port %&gt;
-  username: dbuser
-  password: xy389muw
+  adapter: #{database_adapter}
+  host: #{database_host}
+  port: #{database_port}
+  username: #{database_username}
+  password: #{database_password}
 
 development:
-  database: &lt;%= db_development %&gt;
+  database: #{db_development}
   &lt;&lt;: *login
 
 test:
-  database: &lt;%= db_test %&gt;
+  database: #{db_test}
   &lt;&lt;: *login
 
 production:
-  database: &lt;%= db_production %&gt;
+  database: #{db_production}
   &lt;&lt;: *login
 EOF
 
-  mongrel_cluster_configuration = render :template =&gt; &lt;&lt;-EOF
---- 
-port: &lt;%= mongrel_port %&gt;
-pid_file: &lt;%= mongrel_pid %&gt;
-servers: &lt;%= mongrel_servers %&gt;
-cwd: &lt;%= deploy_to %&gt;/current
-environment: production
+    when &quot;mysql&quot;
+      database_configuration = &lt;&lt;EOF
+#{yml_comment}   
+login: &amp;login
+  adapter: #{database_adapter}
+  host: #{database_host}
+  port: #{database_port}
+  username: #{database_username}
+  password: #{database_password}
+  socket: #{database_socket}
+
+development:
+  database: #{db_development}
+  &lt;&lt;: *login
+
+test:
+  database: #{db_test}
+  &lt;&lt;: *login
+
+production:
+  database: #{db_production}
+  &lt;&lt;: *login
 EOF
+      
+end
 
-  nginx_generator_configuration = render :template =&gt; &lt;&lt;-EOF
-  #######################################################################
-  # Add the following to /etc/nginx/nginx.yml
-  # Then: cd /etc/nginx; generate_nginx_config nginx.yml nginx.conf
-  #######################################################################  
-  &lt;%= application_name %&gt;:
-    # The upstream servers to proxy balance.
-    upstream:&lt;% mongrel_servers.to_i.times do |port| %&gt;
-    - 127.0.0.1:&lt;%= mongrel_port + port %&gt;&lt;% end %&gt;
-    # Just a string of server names.
-    server_name: &lt;%= domain_names %&gt;
-    root: &lt;%= deploy_to %&gt;/current/public
-  #######################################################################
+  mongrel_cluster_configuration = &lt;&lt;EOF
+#{yml_comment}
+--- 
+port: #{mongrel_port}
+pid_file: #{mongrel_pid}
+servers: #{mongrel_servers}
+cwd: #{deploy_to}/current
+environment: production
 EOF
 
-  run &quot;mkdir -p #{deploy_to}/shared/config&quot; 
+  puts &quot;###########################################&quot;  
+  puts &quot;Step 2: Creating necessary directories on\n your Rails Boxcar!&quot;
+  puts &quot;###########################################&quot;  
+  run &quot;mkdir -p #{shared_dir}/config&quot; 
   
+  puts &quot;###########################################&quot;  
+  puts &quot;Step 3: Uploading database.yml to Boxcar&quot;
+  puts &quot;###########################################&quot;
+    
   # Create the database.yml file
-  put database_configuration, &quot;#{deploy_to}/#{shared_dir}/config/database.yml&quot;
+  put database_configuration, &quot;#{shared_dir}/config/database.yml&quot;
+
+  puts &quot;###########################################&quot;  
+  puts &quot;Step 4: Uploding mongrel cluster config to\n your Rails Boxcar.&quot;
+  puts &quot;###########################################&quot;  
   
   # Create mongrel cluster configuration
   put mongrel_cluster_configuration, mongrel_conf  
-  
-  # Print the nginx configuration information for the person deploying.
-  puts nginx_generator_configuration
+
+  puts &quot;###########################################&quot;  
+  puts &quot;DONE! Now run cap deploy:cold&quot;
+  puts &quot;###########################################&quot;  
 end
 
 desc &quot;Link in the production database.yml&quot; 
 task :after_update_code do
-  run &quot;ln -nfs #{deploy_to}/#{shared_dir}/config/database.yml #{release_path}/config/database.yml&quot;
-end
\ No newline at end of file
+  run &quot;ln -nfs #{shared_dir}/config/database.yml #{release_path}/config/database.yml&quot;
+end
+</diff>
      <filename>config/deploy.rb</filename>
    </modified>
    <modified>
      <diff>@@ -5,7 +5,7 @@
 # ENV['RAILS_ENV'] ||= 'production'
 
 # Specifies gem version of Rails to use when vendor/rails is not present
-RAILS_GEM_VERSION = '1.2.3' unless defined? RAILS_GEM_VERSION
+RAILS_GEM_VERSION = '1.2.5' unless defined? RAILS_GEM_VERSION
 
 # Bootstrap the Rails environment, frameworks, and default configuration
 require File.join(File.dirname(__FILE__), 'boot')</diff>
      <filename>config/environment.rb</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>47008873ccc7f3e74c34540422dc2d1b44067576</id>
    </parent>
  </parents>
  <author>
    <name>Robby Russell</name>
    <email>robby@planetargon.com</email>
  </author>
  <url>http://github.com/kohlhofer/rubyurl/commit/a23c6648d28ee631eecde63ac01a571ba1db1255</url>
  <id>a23c6648d28ee631eecde63ac01a571ba1db1255</id>
  <committed-date>2007-11-25T20:52:33-08:00</committed-date>
  <authored-date>2007-11-25T20:52:33-08:00</authored-date>
  <message>Changing to capistrano2 for deployments

git-svn-id: https://svn.roundhaus.com/planetargon/rubyurl_2-0/trunk@82 f0bc2f90-cf15-dc11-b192-0016e6374d05</message>
  <tree>e68e2d2b7dc35daa7bd39c8fade2ad263bc2f899</tree>
  <committer>
    <name>Robby Russell</name>
    <email>robby@planetargon.com</email>
  </committer>
</commit>
