2011-12-13 21:48:25 +00:00
|
|
|
Capistrano::Configuration.instance(:must_exist).load do
|
|
|
|
namespace :bluepill do
|
2011-12-14 11:06:56 +00:00
|
|
|
set :bluepill_binary, "bundle exec bluepill --no-privileged"
|
2011-12-13 21:48:25 +00:00
|
|
|
|
|
|
|
desc "Stop processes that bluepill is monitoring and quit bluepill"
|
2011-12-14 12:34:44 +00:00
|
|
|
task :quit, :roles => [:app], :on_error => :continue do
|
2011-12-14 11:06:56 +00:00
|
|
|
run "cd #{fetch :current_path} && #{try_sudo} #{bluepill_binary} stop APP_NAME=#{fetch :application}"
|
|
|
|
run "cd #{fetch :current_path} && #{try_sudo} #{bluepill_binary} quit APP_NAME=#{fetch :application}"
|
2011-12-13 21:48:25 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
desc "Load bluepill configuration and start it"
|
|
|
|
task :start, :roles => [:app] do
|
2011-12-14 11:06:56 +00:00
|
|
|
run "cd #{fetch :current_path} && #{try_sudo} #{bluepill_binary} load config/production.pill APP_NAME=#{fetch :application}"
|
2011-12-13 21:48:25 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
desc "Prints bluepills monitored processes statuses"
|
|
|
|
task :status, :roles => [:app] do
|
2011-12-14 11:06:56 +00:00
|
|
|
run "cd #{fetch :current_path} && #{try_sudo} #{bluepill_binary} status APP_NAME=#{fetch :application}"
|
2011-12-13 21:48:25 +00:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|