-
Notifications
You must be signed in to change notification settings - Fork 1
/
stage.rb
34 lines (27 loc) · 1.05 KB
/
stage.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
Capistrano::Configuration.instance(:must_exist).load do
desc 'Set the target stage to staging'
task :staging do
set :stage, :staging
end
desc 'Set the target stage to test'
task :testing do
set :stage, :test
end
# None of this works in a namespace
desc 'Set up stage-dependent properties'
task :setup_stage do
set :base_dir, "#{cookbook[:base_dir]}/#{stage}"
set :deploy_to, "#{base_dir}/#{application}"
set :db_table, application + (stage == :staging ? "_#{stage}" : '')
set :mongrel_port, cookbook[:mongrel_port] + production_mongrels if stage == :staging
set :domain, cookbook[stage][:domain]
set :domains, (cookbook[stage][:other_domains] || []) + [ domain ]
set :branch, cookbook[stage][:branch] || 'master'
set :mongrels, cookbook[stage][:mongrels]
set :auth_user, cookbook[stage][:auth_user]
set :auth_pass, cookbook[stage][:auth_pass]
role :app, domain
role :web, domain
role :db, domain, :primary => true
end
end