This repository has been archived by the owner on Jan 11, 2024. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Switched to using bundler capistrano tasks. Moved custom task definit…
…ions into lib/deploy/. Removed hoptoad-related load path munging as that gem is now in Gemfile.
- Loading branch information
Tom Copeland
committed
Feb 7, 2011
1 parent
0833ae7
commit 00b0fb6
Showing
5 changed files
with
65 additions
and
78 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 |
---|---|---|
@@ -1,3 +1,4 @@ | ||
load 'deploy' if respond_to?(:namespace) # cap2 differentiator | ||
Dir['vendor/plugins/*/recipes/*.rb'].each { |plugin| load(plugin) } | ||
Dir['lib/deploy/*.rb'].each { |r| load(r) } | ||
load 'config/deploy' |
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
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,18 @@ | ||
namespace :bluepill do | ||
desc "Stop processes that bluepill is monitoring and quit bluepill" | ||
task :quit, :roles => [:app] do | ||
sudo "bluepill stop; true" | ||
sudo "bluepill quit; true" | ||
end | ||
|
||
desc "Load bluepill configuration and start it" | ||
task :start, :roles => [:app] do | ||
sudo "bluepill load #{release_path}/config/pills/#{rails_env}.rb" | ||
end | ||
|
||
desc "Prints bluepills monitored processes statuses" | ||
task :status, :roles => [:app] do | ||
sudo "bluepill status" | ||
end | ||
end | ||
|
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,31 @@ | ||
namespace :deploy do | ||
desc "Move in database.yml for this environment" | ||
task :move_in_database_yml, :roles => :app do | ||
run "cp #{deploy_to}/shared/config/database.yml #{current_path}/config/" | ||
end | ||
|
||
desc "Move in secret settings for this environment" | ||
task :move_in_secret_settings, :roles => :app do | ||
run "cp #{deploy_to}/shared/config/secret.rb #{current_path}/config/secret.rb" | ||
run "cp #{deploy_to}/shared/config/newrelic.yml #{current_path}/config/newrelic.yml" | ||
end | ||
|
||
task :set_config_for_pg_gem, :roles => [:app, :db] do | ||
run "cd #{current_path} && bundle config build.pg --with-pg-config=/usr/local/pgsql/bin/pg_config --no-rdoc --no-ri" | ||
end | ||
|
||
end | ||
|
||
namespace :maintenance do | ||
desc "Go to maintenance mode" | ||
task :on, :roles => :app do | ||
run "touch #{current_path}/tmp/maintenance_mode" | ||
deploy.restart | ||
end | ||
desc "Back to normal non-maintenance mode" | ||
task :off, :roles => :app do | ||
run "rm -f #{current_path}/tmp/maintenance_mode" | ||
deploy.restart | ||
end | ||
end | ||
|
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,11 @@ | ||
namespace :deploy do | ||
desc "Restarting mod_rails with restart.txt" | ||
task :restart, :roles => :app, :except => { :no_release => true } do | ||
run "touch #{current_path}/tmp/restart.txt" | ||
end | ||
|
||
[:start, :stop].each do |t| | ||
desc "#{t} task is a no-op with mod_rails" | ||
task t, :roles => :app do ; end | ||
end | ||
end |