capistrano3-puma 3.0.3 → 3.1.0

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: 55d549d7cb3e0dbaeec810b62a92d8849b2dc8b4
4
- data.tar.gz: 53ee26a9429adca7d5d333393ba93c9439398f55
3
+ metadata.gz: aea05894d90b7b2c3d9e0c8b6da97a0c9bd095a0
4
+ data.tar.gz: fc5089649511e22e2965d95e687e87c10aa1f1dd
5
5
  SHA512:
6
- metadata.gz: 9cc4f3473a175e4c74af3244c8b5e758626db8b556bdd0c72501b7053a2995ddecd18c3f0b42eb5764b6e948d73f8b62274e012e4171ca701ce03508b618b30d
7
- data.tar.gz: e9669146b2f239bd934ac1b014e4e24af981b78325accdba11dc2f1c2c8191c1aec2a331cda7c24d1323bbd2fb61ff6cd01c4bc5751b39080950169b0ea579aa
6
+ metadata.gz: b35bfb74e3004346403dd141d7fc9f9892ac897a26f7b1cc5f3dcf52962c917b96566e466c287cc74fcd305389b430a2c39bd6dc94abd30eeda0d3ab4308f3d6
7
+ data.tar.gz: 7176bdadcda38433454f8da5f5528c22ffea4374e1aea66d4c030a2d483b06fb9715f59a3d3ee74ebbb4f5b2eaac53bb9fe8441c98de910218b53d73d8b6f7af
data/CHANGELOG.md CHANGED
@@ -1,4 +1,6 @@
1
1
  ## Changelog
2
+ - 3.1.0:
3
+ - Don't load puma hooks by default.
2
4
  - 3.0.0:
3
5
  - Require capistrano 3.7+
4
6
  - Implement the plugin system
data/CONTRIBUTORS.md CHANGED
@@ -1,54 +1,47 @@
1
1
  ## Contributors
2
2
 
3
- Abdelkader Boudih
4
- André Arko
5
- Ariel Zerahia
6
- Barack Obama
7
- Bart de Water
8
- Benjamin Kim
9
- Bin Huang
10
- Bryan Liles
11
- Claudio Poli
12
- Cyril Rohr
13
- Eric
14
- Fritz Lee
15
- Hnat Kubov
16
- Ivan Schneider
17
- James-Hendrickson
18
- Jens Hausherr
19
- Jeremy Rottman
20
- Jesse Cooke
21
- Johan Lind
22
- Jordan Hollinger
23
- Jun Lin
24
- Kamil Giszczak
25
- Kevin Collignon
26
- Konstantin Papkovskiy
27
- Kyle Decot
28
- Lisa Hagemann
29
- Lonre Wang
30
- Lucas Alves
31
- Marcos Chicote
32
- Matias De Santi
33
- Michael C. Beck
34
- Molfar
35
- Neil Bartley
36
- Peter
37
- Philippe Nénert
38
- Ponomarev Nikolay
39
- Rafael Goulart
40
- RavWar
41
- Ruslan
42
- SHIMADA Koji
43
- Sergey Ponomarev
44
- Shane O'Grady
45
- Simon Males
46
- Steve Madere
47
- Suhail Patel
48
- Suraj Shirvankar
49
- ayaya
50
- dfang
51
- marshall-lee
52
- mizukmb
53
- msbrigna
54
- ruohan.chen
3
+ - Abdelkader Boudih
4
+ - André Arko
5
+ - Ariel Zerahia
6
+ - Barack Obama
7
+ - Bart de Water
8
+ - Benjamin Kim
9
+ - Bin Huang
10
+ - Bryan Liles
11
+ - Claudio Poli
12
+ - Cyril Rohr
13
+ - Fritz Lee
14
+ - Feña Agar
15
+ - Hnat Kubov
16
+ - Ivan Schneider
17
+ - James-Hendrickson
18
+ - Jens Hausherr
19
+ - Jeremy Rottman
20
+ - Jesse Cooke
21
+ - Johan Lind
22
+ - Jordan Hollinger
23
+ - Jun Lin
24
+ - Kamil Giszczak
25
+ - Kevin Collignon
26
+ - Konstantin Papkovskiy
27
+ - Kyle Decot
28
+ - Lisa Hagemann
29
+ - Lonre Wang
30
+ - Lucas Alves
31
+ - Marcos Chicote
32
+ - Mario Celit log
33
+ - Matias De Santi
34
+ - Michael C. Beck
35
+ - Neil Bartley
36
+ - Philippe Nénert
37
+ - Ponomarev Nikolay
38
+ - Rafael Goulart
39
+ - SHIMADA Koji
40
+ - Sergey Ponomarev
41
+ - Shane O'Grady
42
+ - Simon Males
43
+ - Steve Madere
44
+ - Suhail Patel
45
+ - Suraj Shirvankar
46
+ - marshall-lee
47
+ - ruohan chen
data/README.md CHANGED
@@ -20,19 +20,29 @@ And then execute:
20
20
  # Capfile
21
21
 
22
22
  require 'capistrano/puma'
23
+ install_plugin Capistrano::Puma # Default puma tasks
23
24
  install_plugin Capistrano::Puma::Workers # if you want to control the workers (in cluster mode)
24
25
  install_plugin Capistrano::Puma::Jungle # if you need the jungle tasks
25
26
  install_plugin Capistrano::Puma::Monit # if you need the monit tasks
26
27
  install_plugin Capistrano::Puma::Nginx # if you want to upload a nginx site template
27
28
  ```
28
29
 
30
+ To prevent loading the hooks of the plugin, add false to the load_hooks param.
31
+ ```ruby
32
+ # Capfile
33
+
34
+ require 'capistrano/puma'
35
+ install_plugin Capistrano::Puma, load_hooks: false # Default puma tasks without hooks
36
+ install_plugin Capistrano::Puma::Monit, load_hooks: false # Monit tasks without hooks
37
+ ```
38
+
29
39
  ### Config
30
40
 
31
41
  To list available tasks use `cap -T`
32
42
 
33
43
  To upload puma config use:
34
44
  ```ruby
35
- cap puma:config
45
+ cap puma:config
36
46
  ```
37
47
  By default the file located in `shared/puma.config`
38
48
 
@@ -102,6 +112,7 @@ Configurable options, shown here with defaults: Please note the configuration op
102
112
  set :puma_state, "#{shared_path}/tmp/pids/puma.state"
103
113
  set :puma_pid, "#{shared_path}/tmp/pids/puma.pid"
104
114
  set :puma_bind, "unix://#{shared_path}/tmp/sockets/puma.sock" #accept array for multi-bind
115
+ set :puma_control_app, false
105
116
  set :puma_default_control_app, "unix://#{shared_path}/tmp/sockets/pumactl.sock"
106
117
  set :puma_conf, "#{shared_path}/puma.rb"
107
118
  set :puma_access_log, "#{shared_path}/log/puma_access.log"
@@ -115,9 +126,15 @@ Configurable options, shown here with defaults: Please note the configuration op
115
126
  set :puma_preload_app, false
116
127
  set :puma_daemonize, true
117
128
  set :puma_plugins, [] #accept array of plugins
129
+ set :puma_tag, fetch(:application)
118
130
  set :nginx_use_ssl, false
119
131
  ```
120
132
 
133
+ __Notes:__ If you are setting values for variables that might be used by other plugins, use `append` instead of `set`. For example:
134
+ ```ruby
135
+ append :rbenv_map_bins, 'puma', 'pumactl'
136
+ ```
137
+
121
138
  ## Contributing
122
139
 
123
140
  1. Fork it
@@ -22,7 +22,7 @@ Gem::Specification.new do |spec|
22
22
  spec.add_dependency 'capistrano-bundler'
23
23
  spec.add_dependency 'puma' , '~> 3.4'
24
24
  spec.post_install_message = %q{
25
- [capistrano-puma] Plugins need to be explicitly installed with install_plugin.
25
+ All plugins need to be explicitly installed with install_plugin.
26
26
  Please see README.md
27
27
  }
28
28
  end
@@ -42,6 +42,7 @@ module Capistrano
42
42
  "config/deploy/templates/#{from}.rb",
43
43
  "config/deploy/templates/#{from}.erb",
44
44
  File.expand_path("../templates/#{from}.erb", __FILE__),
45
+ File.expand_path("../templates/#{from}.rb.erb", __FILE__)
45
46
  ].detect { |path| File.file?(path) }
46
47
  erb = File.read(file)
47
48
  backend.upload! StringIO.new(ERB.new(erb, nil, '-').result(binding)), to
@@ -66,6 +67,7 @@ module Capistrano
66
67
  set_if_empty :puma_state, -> { File.join(shared_path, 'tmp', 'pids', 'puma.state') }
67
68
  set_if_empty :puma_pid, -> { File.join(shared_path, 'tmp', 'pids', 'puma.pid') }
68
69
  set_if_empty :puma_bind, -> { File.join("unix://#{shared_path}", 'tmp', 'sockets', 'puma.sock') }
70
+ set_if_empty :puma_control_app, false
69
71
  set_if_empty :puma_default_control_app, -> { File.join("unix://#{shared_path}", 'tmp', 'sockets', 'pumactl.sock') }
70
72
  set_if_empty :puma_conf, -> { File.join(shared_path, 'puma.rb') }
71
73
  set_if_empty :puma_access_log, -> { File.join(shared_path, 'log', 'puma_access.log') }
@@ -73,6 +75,7 @@ module Capistrano
73
75
  set_if_empty :puma_init_active_record, false
74
76
  set_if_empty :puma_preload_app, false
75
77
  set_if_empty :puma_daemonize, false
78
+ set_if_empty :puma_tag, ''
76
79
 
77
80
  # Chruby, Rbenv and RVM integration
78
81
  append :chruby_map_bins, 'puma', 'pumactl'
@@ -107,11 +110,10 @@ module Capistrano
107
110
  end
108
111
 
109
112
  def upload_puma_rb(role)
110
- template_puma 'puma.rb', fetch(:puma_conf), role
113
+ template_puma 'puma', fetch(:puma_conf), role
111
114
  end
112
115
  end
113
116
  end
114
- install_plugin Capistrano::Puma
115
117
 
116
118
  require 'capistrano/puma/workers'
117
119
  require 'capistrano/puma/monit'
@@ -1,3 +1,3 @@
1
1
  module Capistrano
2
- PumaVERSION = '3.0.3'
2
+ PumaVERSION = '3.1.0'
3
3
  end
@@ -1,7 +1,9 @@
1
1
  module Capistrano
2
2
  class Puma::Workers < Capistrano::Plugin
3
+ include PumaCommon
4
+
3
5
  def define_tasks
4
6
  eval_rakefile File.expand_path('../../tasks/workers.rake', __FILE__)
5
7
  end
6
8
  end
7
- end
9
+ end
@@ -9,7 +9,8 @@ namespace :puma do
9
9
  #TODO
10
10
  # cleanup
11
11
  # add host name/ip
12
- workers_count = capture("ps ax | grep -c 'puma: cluster worker [0-9]: `cat #{fetch(:puma_pid)}`'").to_i - 1
12
+ puma_pid = capture("cat #{fetch(:puma_pid)}")
13
+ workers_count = capture("ps ax | grep -c 'puma: cluster worker [0-9]: #{puma_pid}'").to_i
13
14
  log "Workers count : #{workers_count}"
14
15
  end
15
16
  end
@@ -23,7 +24,8 @@ namespace :puma do
23
24
  task :more do
24
25
  on roles(fetch(:puma_role)) do |role|
25
26
  git_plugin.puma_switch_user(role) do
26
- execute(:kill, "-TTIN `cat #{fetch(:puma_pid)}`")
27
+ puma_pid = capture("cat #{fetch(:puma_pid)}")
28
+ execute(:kill, "-TTIN #{puma_pid}")
27
29
  end
28
30
  end
29
31
  end
@@ -32,7 +34,8 @@ namespace :puma do
32
34
  task :less do
33
35
  on roles(fetch(:puma_role)) do |role|
34
36
  git_plugin.puma_switch_user(role) do
35
- execute(:kill, "-TTOU `cat #{fetch(:puma_pid)}`")
37
+ puma_pid = capture("cat #{fetch(:puma_pid)}")
38
+ execute(:kill, "-TTOU #{puma_pid}")
36
39
  end
37
40
  end
38
41
  end
@@ -4,7 +4,7 @@ directory '<%= current_path %>'
4
4
  rackup "<%=fetch(:puma_rackup)%>"
5
5
  environment '<%= fetch(:puma_env) %>'
6
6
  <% if fetch(:puma_tag) %>
7
- tag '<%= fetch(:puma_tag)%>'
7
+ tag '<%= fetch(:puma_tag)%>'
8
8
  <% end %>
9
9
  pidfile "<%=fetch(:puma_pid)%>"
10
10
  state_path "<%=fetch(:puma_state)%>"
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: 3.0.3
4
+ version: 3.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Abdelkader Boudih
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-03-23 00:00:00.000000000 Z
11
+ date: 2017-03-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: capistrano
@@ -91,8 +91,8 @@ homepage: https://github.com/seuros/capistrano-puma
91
91
  licenses:
92
92
  - MIT
93
93
  metadata: {}
94
- post_install_message: "\n [capistrano-puma] Plugins need to be explicitly installed
95
- with install_plugin.\n Please see README.md\n "
94
+ post_install_message: "\n All plugins need to be explicitly installed with install_plugin.\n
95
+ \ Please see README.md\n "
96
96
  rdoc_options: []
97
97
  require_paths:
98
98
  - lib