forked from openaustralia/planningalerts
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add a basic Capistrano recipe to this repository
- Loading branch information
Showing
2 changed files
with
43 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
set :application, "planningalerts.org.au/app" | ||
set :repository, "git://git.openaustralia.org/planningalerts-app.git" | ||
|
||
set :scm, :git | ||
|
||
set :stage, "test" unless exists? :stage | ||
|
||
set :use_sudo, false | ||
|
||
if stage == "production" | ||
set :deploy_to, "/srv/www/www.#{application}" | ||
elsif stage == "test" | ||
set :deploy_to, "/srv/www/test.#{application}" | ||
#set :branch, "test" | ||
end | ||
|
||
set :user, "deploy" | ||
|
||
role :web, "openaustralia.org" | ||
|
||
namespace :deploy do | ||
desc "After a code update, we link additional config and the scrapers" | ||
after "deploy:update_code" do | ||
links = { | ||
"#{release_path}/config/database.yml" => "#{deploy_to}/shared/database.yml", | ||
"#{release_path}/app/models/configuration.rb" => "#{deploy_to}/shared/configuration.rb", | ||
"#{release_path}/config/production.sphinx.conf" => "#{deploy_to}/shared/production.sphinx.conf", | ||
"#{release_path}/config/sphinx.yml" => "#{deploy_to}/shared/sphinx.yml", | ||
"#{deploy_to}/../parsers/current/public" => "#{current_path}/public/scrapers" | ||
} | ||
|
||
# "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 | ||
|
||
task :restart, :except => { :no_release => true } do | ||
run "touch #{File.join(current_path,'tmp','restart.txt')}" | ||
end | ||
end |