Permalink
Browse files

Added changes

  • Loading branch information...
jasonnoble committed Dec 5, 2009
1 parent bb05681 commit 7e6152186267b171a873fdf613cb7c26a3b31a7f
Showing with 73 additions and 2 deletions.
  1. +4 −0 Capfile
  2. +2 −2 config/database.yml
  3. +59 −0 config/deploy.rb
  4. +8 −0 config/mongrel_cluster.yml
View
@@ -0,0 +1,4 @@
+load 'deploy' if respond_to?(:namespace) # cap2 differentiator
+Dir['vendor/plugins/*/recipes/*.rb'].each { |plugin| load(plugin) }
+
+load 'config/deploy' # remove this line to skip loading any of the default tasks
View
@@ -36,7 +36,7 @@ test:
production:
adapter: mysql
encoding: utf8
- database: depot_production
+ database: depot_production_jasonn2
username: root
password:
- socket: /tmp/mysql.sock
+ socket: /var/lib/mysql/mysql.sock
View
@@ -0,0 +1,59 @@
+set :application, "shopping_cart"
+set :repository, 'git@github.com:jasonnoble/capistrano-demo.git'
+
+# set :scm_command, "/usr/local/git/bin/git"
+# set :local_scm_command, "git"
+
+default_run_options[:pty] = true
+
+set :scm, :git
+set :user, "jasonn3"
+set :branch, "master"
+set :deploy_to, "/var/www/rails/#{user}/#{application}"
+set :deploy_via, :remote_cache
+set :use_sudo, false
+# Or: `accurev`, `bzr`, `cvs`, `darcs`, `git`, `mercurial`, `perforce`, `subversion` or `none`
+
+role :web, "192.168.255.200" # Your HTTP server, Apache/etc
+role :app, "192.168.255.200" # This may be the same as your `Web` server
+role :db, "192.168.255.200", :primary => true # This is where Rails migrations will run
+
+set :mongrel_conf, "#{current_path}/config/mongrel_cluster.yml"
+
+# role :db, "your slave db-server here"
+
+# If you are using Passenger mod_rails uncomment this:
+# if you're still using the script/reapear helper you will need
+# these http://github.com/rails/irs_process_scripts
+
+# namespace :deploy do
+# task :start {}
+# task :stop {}
+# task :restart, :roles => :app, :except => { :no_release => true } do
+# run "#{try_sudo} touch #{File.join(current_path,'tmp','restart.txt')}"
+# end
+# end
+
+namespace :deploy do
+ namespace :mongrel do
+ [:stop, :start, :restart ].each do |t|
+ desc "#{t.to_s.capitalize} the mongrel appserver"
+ task t, :roles => :app do
+ invoke_command "/opt/ruby-enterprise-1.8.7-2009.10/bin/mongrel_rails cluster::#{t.to_s} -C #{mongrel_conf}", :via => run_method
+ end
+ end
+ end
+
+ desc "Customer restart task for mongrel cluster"
+ task :restart, :roles => :app, :except => { :no_release => true } do
+ deploy.mongrel.restart
+ end
+ desc "Customer start task for mongrel cluster"
+ task :start, :roles => :app, :except => { :no_release => true } do
+ deploy.mongrel.start
+ end
+ desc "Customer stop task for mongrel cluster"
+ task :stop, :roles => :app, :except => { :no_release => true } do
+ deploy.mongrel.stop
+ end
+end
@@ -0,0 +1,8 @@
+---
+cwd: /var/www/rails/jasonn2/shopping_cart/current
+log_file: log/mongrel.log
+port: "7000"
+environment: production
+address: 0.0.0.0
+pid_file: tmp/pids/mongrel.pid
+servers: 2

0 comments on commit 7e61521

Please sign in to comment.