Sha256: c4985b57f7bc603e4e0a25245a83e05353cbf0f2b834949f837a7a819ac0d3fa

Contents?: true

Size: 1.84 KB

Versions: 78

Compression:

Stored size: 1.84 KB

Contents

namespace :rubber do

  namespace :resque do
  
    rubber.allow_optional_tasks(self)

    namespace :worker do

      rubber.allow_optional_tasks(self)

      before "deploy:stop", "rubber:resque:worker:stop"
      after "deploy:start", "rubber:resque:worker:start"
      after "deploy:restart", "rubber:resque:worker:restart"

      desc "Starts resque workers"
      task :start, :roles => :resque_worker do
        rsudo "cd #{current_path} && RUBBER_ENV=#{rails_env} ./script/resque_worker_management.rb start", :as => rubber_env.app_user
      end

      desc "Stops resque workers"
      task :stop, :roles => :resque_worker do
        rsudo "cd #{current_path} && RUBBER_ENV=#{rails_env} ./script/resque_worker_management.rb stop", :as => rubber_env.app_user
      end

      desc "Restarts resque workers"
      task :restart, :roles => :resque_worker do
        rsudo "cd #{current_path} && RUBBER_ENV=#{rails_env} ./script/resque_worker_management.rb restart", :as => rubber_env.app_user
      end
    end

    namespace :web do
      rubber.allow_optional_tasks(self)

      before "deploy:stop", "rubber:resque:web:stop"
      after "deploy:start", "rubber:resque:web:start"
      after "deploy:restart", "rubber:resque:web:restart"

      desc "Starts resque web tools"
      task :start, :roles => :resque_web do
        rsudo "RAILS_ENV=#{RUBBER_ENV} resque-web --pid-file /var/run/resque_web.pid --port #{rubber_env.resque_web_port} --no-launch #{current_path}/config/initializers/resque.rb"
      end

      desc "Stops resque web tools"
      task :stop, :roles => :resque_web do
        rsudo "RAILS_ENV=#{RUBBER_ENV} resque-web --pid-file /var/run/resque_web.pid --kill"
      end

      desc "Restarts resque web tools"
      task :restart, :roles => :resque_web do
        rubber.resque.web.stop
        rubber.resque.web.start
      end

    end

  end
end

Version data entries

78 entries across 39 versions & 6 rubygems

Version Path
rubber-1.10.1 generators/vulcanize/templates/resque/config/rubber/deploy-resque.rb
rubber-1.10.1 lib/generators/vulcanize/templates/resque/config/rubber/deploy-resque.rb
rubber-jcarnegie-0.0.1 lib/generators/vulcanize/templates/resque/config/rubber/deploy-resque.rb
rubber-jcarnegie-0.0.1 generators/vulcanize/templates/resque/config/rubber/deploy-resque.rb
rubber-1.9.1 generators/vulcanize/templates/resque/config/rubber/deploy-resque.rb
rubber-1.9.1 lib/generators/vulcanize/templates/resque/config/rubber/deploy-resque.rb
rubber-1.9.0 lib/generators/vulcanize/templates/resque/config/rubber/deploy-resque.rb
rubber-1.9.0 generators/vulcanize/templates/resque/config/rubber/deploy-resque.rb
rubber-1.8.0 lib/generators/vulcanize/templates/resque/config/rubber/deploy-resque.rb
rubber-1.8.0 generators/vulcanize/templates/resque/config/rubber/deploy-resque.rb
nogara-rubber-1.7.2 lib/generators/vulcanize/templates/resque/config/rubber/deploy-resque.rb
nogara-rubber-1.7.2 generators/vulcanize/templates/resque/config/rubber/deploy-resque.rb
rubber-1.7.2 generators/vulcanize/templates/resque/config/rubber/deploy-resque.rb
rubber-1.7.2 lib/generators/vulcanize/templates/resque/config/rubber/deploy-resque.rb
rubber-1.7.1 generators/vulcanize/templates/resque/config/rubber/deploy-resque.rb
rubber-1.7.1 lib/generators/vulcanize/templates/resque/config/rubber/deploy-resque.rb
rubber-1.7.0 generators/vulcanize/templates/resque/config/rubber/deploy-resque.rb
rubber-1.7.0 lib/generators/vulcanize/templates/resque/config/rubber/deploy-resque.rb
rubber-1.6.3 lib/generators/vulcanize/templates/resque/config/rubber/deploy-resque.rb
rubber-1.6.3 generators/vulcanize/templates/resque/config/rubber/deploy-resque.rb