Skip to content

Commit e9aba41

Browse files
committed
Updated rails environemtn
1 parent 8d7f248 commit e9aba41

File tree

3 files changed

+59
-1
lines changed

3 files changed

+59
-1
lines changed

Capfile

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
load 'deploy' if respond_to?(:namespace) # cap2 differentiator
2+
Dir['vendor/plugins/*/recipes/*.rb'].each { |plugin| load(plugin) }
3+
load 'config/deploy'

config/deploy.rb

+56
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
default_run_options[:pty] = true
2+
3+
set :application, "authlogic_example.binarylogic.com"
4+
set :repository, "[email protected]:binarylogic/authlogic_example.git"
5+
set :keep_releases, 5
6+
7+
set :scm, :git
8+
set :deploy_via, :remote_cache # prevent git from cloning on every deploy
9+
set :deploy_to, "/var/www/#{application}"
10+
set :branch, "master"
11+
12+
set :thin_conf, "#{current_path}/config/thin.yml" # must be set after :deploy_to is set
13+
14+
set :user, 'root'
15+
set :runner, 'root'
16+
set :use_sudo, false
17+
18+
role :app, "binarylogic.com"
19+
role :web, "binarylogic.com"
20+
role :db, "binarylogic.com", :primary => true
21+
22+
task :after_update_code do
23+
# handle shared files
24+
%w{/config/database.yml /config/thin.yml}.each do |file|
25+
run "ln -nfs #{shared_path}#{file} #{release_path}#{file}"
26+
end
27+
28+
deploy.cleanup
29+
end
30+
31+
namespace :deploy do
32+
namespace :thin do
33+
[ :stop, :start, :restart ].each do |t|
34+
desc "#{t.to_s.capitalize} the thin servers"
35+
task t, :roles => :app do
36+
#invoke_command checks the use_sudo variable to determine how to run the thin command
37+
invoke_command "thin #{t.to_s} -C #{thin_conf}", :via => run_method
38+
end
39+
end
40+
end
41+
42+
desc "Custom restart task for thin cluster"
43+
task :restart, :roles => :app, :except => { :no_release => true } do
44+
deploy.thin.restart
45+
end
46+
47+
desc "Custom start task for thin cluster"
48+
task :start, :roles => :app do
49+
deploy.thin.start
50+
end
51+
52+
desc "Custom stop task for thin cluster"
53+
task :stop, :roles => :app do
54+
deploy.thin.stop
55+
end
56+
end

config/environments/production.rb

-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
# Full error reports are disabled and caching is turned on
1111
config.action_controller.consider_all_requests_local = false
1212
config.action_controller.perform_caching = true
13-
config.action_view.cache_template_loading = true
1413

1514
# Use a different cache store in production
1615
# config.cache_store = :mem_cache_store

0 commit comments

Comments
 (0)