mirror of
https://github.com/puma/puma.git
synced 2022-11-09 13:48:40 -05:00
creating a capistrano recipe to ease the deployment process
This commit is contained in:
parent
c952c04eed
commit
ce11c6517c
2 changed files with 30 additions and 0 deletions
|
@ -1,3 +1,8 @@
|
|||
=== 2.0.0.b2 / 2012-10-17
|
||||
* 1 minor feature:
|
||||
* Now Puma is bundled with an capistrano recipe. Just require
|
||||
'puma/capistrano' in you deploy.rb
|
||||
|
||||
=== 2.0.0.b1 / 2012-09-11
|
||||
|
||||
* 1 major feature:
|
||||
|
|
25
lib/puma/capistrano.rb
Normal file
25
lib/puma/capistrano.rb
Normal file
|
@ -0,0 +1,25 @@
|
|||
Capistrano::Configuration.instance.load do
|
||||
after "deploy:stop", "puma:stop"
|
||||
after "deploy:start", "puma:start"
|
||||
after "deploy:restart", "puma:restart"
|
||||
|
||||
_cset(:puma_role) { :app }
|
||||
|
||||
namespace :puma do
|
||||
desc "Start puma"
|
||||
task :start, :roles => lambda { fetch(:puma_role) }, :on_no_matching_servers => :continue do
|
||||
run "cd #{current_path} && RAILS_ENV=#{stage} #{fetch(:bundle_cmd, "bundle")} exec puma -b 'unix://#{shared_path}/sockets/puma.sock' -S #{shared_path}/sockets/puma.state --control 'unix://#{shared_path}/sockets/pumactl.sock' >> #{shared_path}/log/puma-#{stage}.log 2>&1 &", :pty => false
|
||||
end
|
||||
|
||||
desc "Stop puma"
|
||||
task :stop, :roles => lambda { fetch(:puma_role) }, :on_no_matching_servers => :continue do
|
||||
run "cd #{current_path} && #{fetch(:bundle_cmd, "bundle")} exec pumactl -S #{shared_path}/sockets/puma.state stop ; fi"
|
||||
end
|
||||
|
||||
desc "Restart puma"
|
||||
task :restart, :roles => lambda { fetch(:puma_role) }, :on_no_matching_servers => :continue do
|
||||
run "cd #{current_path} && #{fetch(:bundle_cmd, "bundle")} exec pumactl -S #{shared_path}/sockets/puma.state restart ; fi"
|
||||
end
|
||||
|
||||
end
|
||||
end
|
Loading…
Add table
Add a link
Reference in a new issue