Permalink
Browse files

creating a capistrano recipe to ease the deployment process

  • Loading branch information...
1 parent c952c04 commit ce11c6517c50b5078ab47eb0577a18945b0555aa @plentz plentz committed Oct 16, 2012
Showing with 30 additions and 0 deletions.
  1. +5 −0 History.txt
  2. +25 −0 lib/puma/capistrano.rb
View
@@ -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:
View
@@ -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

0 comments on commit ce11c65

Please sign in to comment.