forked from mblaney/electionleaflets
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Capfile
36 lines (29 loc) · 1.18 KB
/
Capfile
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
35
36
load 'deploy' if respond_to?(:namespace) # cap2 differentiator
Dir['vendor/plugins/*/recipes/*.rb'].each { |plugin| load(plugin) }
set :application, "electionleaflets.org.au"
set :repository, "git://git.openaustralia.org/electionleaflets.git"
role :web, "kedumba.openaustraliafoundation.org.au"
set :use_sudo, false
set :user, "deploy"
set :scm, :git
set :stage, "test" unless exists? :stage
if stage == "production"
set :deploy_to, "/srv/www/www.#{application}"
elsif stage == "test"
set :deploy_to, "/srv/www/test.#{application}"
set :branch, "test"
end
namespace :deploy do
desc "Restart doesn't do anything"
task :restart do ; end
desc "Once the deploy is symlinked, we link additional config"
before "deploy:symlink" do
links = {
"#{release_path}/config/general.php" => "#{shared_path}/config/general.php",
"#{release_path}/data" => "#{shared_path}/data",
"#{release_path}/djangoleaflets/settings.py" => "#{shared_path}/djangoleaflets/settings.py"
}
# "ln -sf <a> <b>" creates a symbolic link but deletes <b> if it already exists
run links.map {|a| "ln -sf #{a.last} #{a.first}"}.join(";")
end
end