Created
August 27, 2014 22:28
-
-
Save kevinmtrowbridge/1ec18b0b7bfd3c61f664 to your computer and use it in GitHub Desktop.
Patched capistrano-novafabrica delayed job for rails 4
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
namespace :dj do | |
def delayed_job_command | |
fetch(:delayed_job_command, 'script/delayed_job') | |
end | |
desc "Start delayed_job process" | |
task :start do | |
on roles(:app) do | |
within release_path do | |
with rails_env: (fetch(:rails_env) || fetch(:stage)) do | |
execute :ruby, "#{delayed_job_command} stop" | |
end | |
end | |
end | |
end | |
desc "Stop delayed_job process" | |
task :stop do | |
on roles(:app) do | |
within release_path do | |
with rails_env: (fetch(:rails_env) || fetch(:stage)) do | |
execute :ruby, "#{delayed_job_command} start" | |
end | |
end | |
end | |
end | |
desc "Restart delayed_job process" | |
task :restart do | |
on roles(:app) do | |
within release_path do | |
with rails_env: (fetch(:rails_env) || fetch(:stage)) do | |
execute :ruby, "#{delayed_job_command} stop" | |
end | |
with rails_env: (fetch(:rails_env) || fetch(:stage)) do | |
execute :ruby, "#{delayed_job_command} start" | |
end | |
end | |
end | |
end | |
after "deploy:finished", "dj:restart" | |
end | |
namespace :load do | |
task :defaults do | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment