Permalink
Browse files

Updated rails environemtn

  • Loading branch information...
binarylogic committed Nov 3, 2008
1 parent 8d7f248 commit e9aba41d2a87e7e69f29b48287aaf93bda6fd09c
Showing with 59 additions and 1 deletion.
  1. +3 −0 Capfile
  2. +56 −0 config/deploy.rb
  3. +0 −1 config/environments/production.rb
View
@@ -0,0 +1,3 @@
+load 'deploy' if respond_to?(:namespace) # cap2 differentiator
+Dir['vendor/plugins/*/recipes/*.rb'].each { |plugin| load(plugin) }
+load 'config/deploy'
View
@@ -0,0 +1,56 @@
+default_run_options[:pty] = true
+
+set :application, "authlogic_example.binarylogic.com"
+set :repository, "git@github.com:binarylogic/authlogic_example.git"
+set :keep_releases, 5
+
+set :scm, :git
+set :deploy_via, :remote_cache # prevent git from cloning on every deploy
+set :deploy_to, "/var/www/#{application}"
+set :branch, "master"
+
+set :thin_conf, "#{current_path}/config/thin.yml" # must be set after :deploy_to is set
+
+set :user, 'root'
+set :runner, 'root'
+set :use_sudo, false
+
+role :app, "binarylogic.com"
+role :web, "binarylogic.com"
+role :db, "binarylogic.com", :primary => true
+
+task :after_update_code do
+ # handle shared files
+ %w{/config/database.yml /config/thin.yml}.each do |file|
+ run "ln -nfs #{shared_path}#{file} #{release_path}#{file}"
+ end
+
+ deploy.cleanup
+end
+
+namespace :deploy do
+ namespace :thin do
+ [ :stop, :start, :restart ].each do |t|
+ desc "#{t.to_s.capitalize} the thin servers"
+ task t, :roles => :app do
+ #invoke_command checks the use_sudo variable to determine how to run the thin command
+ invoke_command "thin #{t.to_s} -C #{thin_conf}", :via => run_method
+ end
+ end
+ end
+
+ desc "Custom restart task for thin cluster"
+ task :restart, :roles => :app, :except => { :no_release => true } do
+ deploy.thin.restart
+ end
+
+ desc "Custom start task for thin cluster"
+ task :start, :roles => :app do
+ deploy.thin.start
+ end
+
+ desc "Custom stop task for thin cluster"
+ task :stop, :roles => :app do
+ deploy.thin.stop
+ end
+end
@@ -10,7 +10,6 @@
# Full error reports are disabled and caching is turned on
config.action_controller.consider_all_requests_local = false
config.action_controller.perform_caching = true
-config.action_view.cache_template_loading = true
# Use a different cache store in production
# config.cache_store = :mem_cache_store

0 comments on commit e9aba41

Please sign in to comment.