Sha256: 0c2afc0ff72877c032e367a1c05751ab8660e7017b0a5a204d3d6f88612696c0

Contents?: true

Size: 1.06 KB

Versions: 29

Compression:

Stored size: 1.06 KB

Contents

namespace :rubber do

  namespace :unicorn do
  
    rubber.allow_optional_tasks(self)
    
    before "deploy:stop", "rubber:unicorn:stop"
    after "deploy:start", "rubber:unicorn:start"
    after "deploy:restart", "rubber:unicorn:reload"
    
    desc "Stops the unicorn server"
    task :stop, :roles => :unicorn do
      rsudo "if [ -f /var/run/unicorn.pid ]; then pid=`cat /var/run/unicorn.pid` && kill -TERM $pid; fi"
    end
    
    desc "Starts the unicorn server"
    task :start, :roles => :unicorn do
      rsudo "cd #{current_path} && bundle exec unicorn_rails -c #{current_path}/config/unicorn.rb -E #{Rubber.env} -D"
    end
    
    desc "Restarts the unicorn server"
    task :restart, :roles => :unicorn do
      stop
      start
    end
  
    desc "Reloads the unicorn web server"
    task :reload, :roles => :unicorn do
      rsudo "if [ -f /var/run/unicorn.pid ]; then pid=`cat /var/run/unicorn.pid` && kill -USR2 $pid; else cd #{current_path} && bundle exec unicorn_rails -c #{current_path}/config/unicorn.rb -E #{Rubber.env} -D; fi"
    end
  
  end

end

Version data entries

29 entries across 29 versions & 1 rubygems

Version Path
rubber-2.2.4 templates/unicorn/config/rubber/deploy-unicorn.rb
rubber-2.2.3 templates/unicorn/config/rubber/deploy-unicorn.rb
rubber-2.2.2 templates/unicorn/config/rubber/deploy-unicorn.rb
rubber-2.2.1 templates/unicorn/config/rubber/deploy-unicorn.rb
rubber-2.2.0 templates/unicorn/config/rubber/deploy-unicorn.rb
rubber-2.1.2 templates/unicorn/config/rubber/deploy-unicorn.rb
rubber-2.1.1 templates/unicorn/config/rubber/deploy-unicorn.rb
rubber-2.1.0 templates/unicorn/config/rubber/deploy-unicorn.rb
rubber-2.0.8 templates/unicorn/config/rubber/deploy-unicorn.rb
rubber-2.0.7 templates/unicorn/config/rubber/deploy-unicorn.rb
rubber-2.0.6 templates/unicorn/config/rubber/deploy-unicorn.rb
rubber-2.0.5 templates/unicorn/config/rubber/deploy-unicorn.rb
rubber-2.0.4 templates/unicorn/config/rubber/deploy-unicorn.rb
rubber-2.0.3 templates/unicorn/config/rubber/deploy-unicorn.rb
rubber-2.0.2 templates/unicorn/config/rubber/deploy-unicorn.rb
rubber-2.0.1 templates/unicorn/config/rubber/deploy-unicorn.rb
rubber-2.0.0 templates/unicorn/config/rubber/deploy-unicorn.rb
rubber-2.0.0.pre12 templates/unicorn/config/rubber/deploy-unicorn.rb
rubber-2.0.0.pre11 templates/unicorn/config/rubber/deploy-unicorn.rb
rubber-2.0.0.pre10 templates/unicorn/config/rubber/deploy-unicorn.rb