Sha256: 0b1d80552e091f9d2f27d067f9ef2811e9649666edfe5eb1695d5a6ecdaaab4b

Contents?: true

Size: 973 Bytes

Versions: 29

Compression:

Stored size: 973 Bytes

Contents

Capistrano::Configuration.instance(:must_exist).load do
  define_recipe :delayed_job do |*args|

    options = args.empty? ? {} : args.first
    prefix = options[:prefix] || 'dj'
    set :dj_monit_prefix, prefix unless exists?(:dj_monit_prefix)
    
    namespace :delayed_job do

      desc "Start delayed_job"
      task :start, :only => {:delayed_job => true} do
        sudo "/usr/bin/monit start all -g #{dj_monit_prefix}_#{application}"
      end
      desc "Stop delayed_job"
      task :stop, :only => {:delayed_job => true} do
        sudo "/usr/bin/monit stop all -g #{dj_monit_prefix}_#{application}"
      end
      desc "Restart delayed_job"
      task :restart, :only => {:delayed_job => true} do
        sudo "/usr/bin/monit restart all -g #{dj_monit_prefix}_#{application}"
      end        
    end
  
    after "deploy:restart", "delayed_job:restart"
    after "deploy:start",   "delayed_job:start"
    after "deploy:stop",    "delayed_job:stop"
  end
end

Version data entries

29 entries across 29 versions & 2 rubygems

Version Path
factorylabs-fdlcap-0.3.21 lib/fdlcap/recipes/delayed_job.rb
factorylabs-fdlcap-0.3.23 lib/fdlcap/recipes/delayed_job.rb
factorylabs-fdlcap-0.3.24 lib/fdlcap/recipes/delayed_job.rb
factorylabs-fdlcap-0.3.25 lib/fdlcap/recipes/delayed_job.rb
factorylabs-fdlcap-0.3.26 lib/fdlcap/recipes/delayed_job.rb
factorylabs-fdlcap-0.3.27 lib/fdlcap/recipes/delayed_job.rb
factorylabs-fdlcap-0.3.28 lib/fdlcap/recipes/delayed_job.rb
fdlcap-0.4.17 lib/fdlcap/recipes/delayed_job.rb
fdlcap-0.4.15 lib/fdlcap/recipes/delayed_job.rb
fdlcap-0.4.14 lib/fdlcap/recipes/delayed_job.rb
fdlcap-0.4.13 lib/fdlcap/recipes/delayed_job.rb
fdlcap-0.4.12 lib/fdlcap/recipes/delayed_job.rb
fdlcap-0.4.11 lib/fdlcap/recipes/delayed_job.rb
fdlcap-0.4.10 lib/fdlcap/recipes/delayed_job.rb
fdlcap-0.4.9 lib/fdlcap/recipes/delayed_job.rb
fdlcap-0.4.7 lib/fdlcap/recipes/delayed_job.rb
fdlcap-0.4.6 lib/fdlcap/recipes/delayed_job.rb
fdlcap-0.4.5 lib/fdlcap/recipes/delayed_job.rb
fdlcap-0.4.4 lib/fdlcap/recipes/delayed_job.rb
fdlcap-0.4.3 lib/fdlcap/recipes/delayed_job.rb