capistrano3-puma 0.2.0 → 0.2.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 41eb524bebbe9f9aa005da420778c2957381122f
4
- data.tar.gz: 01e0b3ce4ae3c5d700941d2f042caea4452f8f90
3
+ metadata.gz: e653eb0ed24f3635af405e9eb27304a699fd08b6
4
+ data.tar.gz: e85934ef3d68f2f5515dc667d2c5fd958f52a21b
5
5
  SHA512:
6
- metadata.gz: 5715a489f013dfdabb8dc3b7733fb7c3abf7ac1937938845683116d32e10ca43931b09f22aab672e9dc42c000bd60d4da0c8a6d0f777e9229a16b81355498e72
7
- data.tar.gz: ee48a9b9ee95fd7d31dfa723e1d22d23a76b21c81017934e31c7e799833d0d8b2b393e670f390233b1830763fcd71b8e21358101fdfbb452b89f0d54fee43462
6
+ metadata.gz: 95a013f371218024fa1c83f849599a50401e7fd274cf0d5591ee9858cbb2f4496fe6c662ec7e8a1774a7bad3d092ac4812ed4de18e7967c4a85f7a107434d521
7
+ data.tar.gz: afea24db1646f1daacd09da497d3b4fbfa5b85880edcb2773f4ca32b3deab351196e04a215a5991aea025853c3beed3f8d3904f47e75824d0ec4ba9a715ed6e0
data/README.md CHANGED
@@ -40,6 +40,7 @@ Configurable options, shown here with defaults: Please note the configuration op
40
40
  set :puma_threads, [0, 16]
41
41
  set :puma_workers, 0
42
42
  set :puma_init_active_record, false
43
+ set :puma_preload_app, true
43
44
  ```
44
45
  For Jungle tasks (beta), these options exist:
45
46
  ```ruby
@@ -51,7 +52,8 @@ Ensure that the following directories are shared (via ``linked_dirs``):
51
52
  tmp/pids tmp/sockets log
52
53
 
53
54
  ## Changelog
54
-
55
+ - 0.2.2: Application pre-loading is optional now (set puma_preload_app to false to turn it off)
56
+ - 0.2.1: Tasks are run within rack context
55
57
  - 0.2.0: Support for puma `ActiveRecord::Base.establish_connection` on
56
58
  boot
57
59
  - 0.1.3: Capistrano 3.1 support
@@ -62,6 +64,9 @@ Ensure that the following directories are shared (via ``linked_dirs``):
62
64
  - 0.0.8: puma.rb is automatically generated if not present. Fixed RVM issue.
63
65
  - 0.0.7: Gem pushed to rubygems as capistrano3-puma. Support of Redhat based OS for Jungle init script.
64
66
 
67
+ ## TODO
68
+ - Support to https://github.com/puma/puma/pull/399 with puma:workers:more, puma:workers:less
69
+
65
70
  ## Contributors
66
71
 
67
72
  - [Ruohan Chen] (https://github.com/crhan)
@@ -1,5 +1,5 @@
1
1
  module Capistrano
2
2
  module Puma
3
- VERSION = '0.2.0'
3
+ VERSION = '0.2.2'
4
4
  end
5
5
  end
@@ -13,6 +13,7 @@ namespace :load do
13
13
  set :puma_access_log, -> { File.join(shared_path, 'log', 'puma_error.log') }
14
14
  set :puma_error_log, -> { File.join(shared_path, 'log', 'puma_access.log') }
15
15
  set :puma_init_active_record, false
16
+ set :puma_preload_app, true
16
17
 
17
18
  # Rbenv and RVM integration
18
19
  set :rbenv_map_bins, fetch(:rbenv_map_bins).to_a.concat(%w{ puma pumactl })
@@ -33,7 +34,9 @@ namespace :puma do
33
34
  task :start do
34
35
  on roles (fetch(:puma_role)) do
35
36
  within current_path do
36
- execute :bundle, 'exec', :puma, "-C #{fetch(:puma_conf)}"
37
+ with rack_env: fetch(:puma_env) do
38
+ execute :bundle, 'exec', :puma, "-C #{fetch(:puma_conf)}"
39
+ end
37
40
  end
38
41
  end
39
42
  end
@@ -43,7 +46,9 @@ namespace :puma do
43
46
  task command do
44
47
  on roles (fetch(:puma_role)) do
45
48
  within current_path do
46
- execute :bundle, 'exec', :pumactl, "-S #{fetch(:puma_state)} #{command}"
49
+ with rack_env: fetch(:puma_env) do
50
+ execute :bundle, 'exec', :pumactl, "-S #{fetch(:puma_state)} #{command}"
51
+ end
47
52
  end
48
53
  end
49
54
  end
@@ -55,12 +60,14 @@ namespace :puma do
55
60
  task command do
56
61
  on roles (fetch(:puma_role)) do
57
62
  within current_path do
58
- if test "[ -f #{fetch(:puma_pid)} ]" and test "kill -0 $( cat #{fetch(:puma_pid)} )"
59
- # NOTE pid exist but state file is nonsense, so ignore that case
60
- execute :bundle, 'exec', :pumactl, "-S #{fetch(:puma_state)} #{command}"
61
- else
62
- # Puma is not running or state file is not present : Run it
63
- execute :bundle, 'exec', :puma, "-C #{fetch(:puma_conf)}"
63
+ with rack_env: fetch(:puma_env) do
64
+ if test "[ -f #{fetch(:puma_pid)} ]" and test "kill -0 $( cat #{fetch(:puma_pid)} )"
65
+ # NOTE pid exist but state file is nonsense, so ignore that case
66
+ execute :bundle, 'exec', :pumactl, "-S #{fetch(:puma_state)} #{command}"
67
+ else
68
+ # Puma is not running or state file is not present : Run it
69
+ execute :bundle, 'exec', :puma, "-C #{fetch(:puma_conf)}"
70
+ end
64
71
  end
65
72
  end
66
73
  end
@@ -10,10 +10,12 @@ threads <%=fetch(:puma_threads).join(',')%>
10
10
  bind "<%=fetch(:puma_bind)%>"
11
11
 
12
12
  workers <%= puma_workers %>
13
+ <% if fetch(:puma_preload_app) %>
13
14
  preload_app!
15
+ <% end %>
14
16
 
15
17
  on_restart do
16
- puts 'On restart...Refresh ENV["BUNDLE_GEMFILE"]'
18
+ puts 'Refreshing Gemfile'
17
19
  ENV["BUNDLE_GEMFILE"] = "<%= fetch(:bundle_gemfile, "#{current_path}/Gemfile") %>"
18
20
  end
19
21
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: capistrano3-puma
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Abdelkader Boudih
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-01-28 00:00:00.000000000 Z
11
+ date: 2014-02-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: capistrano