Last active
August 29, 2015 13:57
-
-
Save kamiller/9416827 to your computer and use it in GitHub Desktop.
capistrano recipe to start/stop/restart daemonized clockwork
This file contains hidden or 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
# Tasks to start/stop/restart a daemonized clockwork instance | |
namespace :clockwork do | |
desc "Start clockwork" | |
task :start, :roles => [:app] do | |
run "cd #{current_path} && RAILS_ENV=#{rails_env} bundle exec clockworkd -c #{current_path}/config/clock.rb --pid-dir #{shared_path}/pids --log --log-dir #{shared_path}/log start" | |
end | |
task :stop, :roles => [:app] do | |
run "cd #{current_path} && RAILS_ENV=#{rails_env} bundle exec clockworkd -c #{current_path}/config/clock.rb --pid-dir #{shared_path}/pids --log --log-dir #{shared_path}/log stop" | |
end | |
task :restart, :roles => [:app] do | |
run "cd #{current_path} && RAILS_ENV=#{rails_env} bundle exec clockworkd -c #{current_path}/config/clock.rb --pid-dir #{shared_path}/pids --log --log-dir #{shared_path}/log restart" | |
end | |
end | |
after "deploy:stop", "clockwork:stop" | |
after "deploy:start", "clockwork:start" | |
before "deploy:restart", "clockwork:restart" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment