capistrano3-puma 3.0.3 → 3.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +2 -0
- data/CONTRIBUTORS.md +45 -52
- data/README.md +18 -1
- data/capistrano3-puma.gemspec +1 -1
- data/lib/capistrano/puma.rb +4 -2
- data/lib/capistrano/puma/version.rb +1 -1
- data/lib/capistrano/puma/workers.rb +3 -1
- data/lib/capistrano/tasks/workers.rake +6 -3
- data/lib/capistrano/templates/puma.rb.erb +1 -1
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: aea05894d90b7b2c3d9e0c8b6da97a0c9bd095a0
|
4
|
+
data.tar.gz: fc5089649511e22e2965d95e687e87c10aa1f1dd
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b35bfb74e3004346403dd141d7fc9f9892ac897a26f7b1cc5f3dcf52962c917b96566e466c287cc74fcd305389b430a2c39bd6dc94abd30eeda0d3ab4308f3d6
|
7
|
+
data.tar.gz: 7176bdadcda38433454f8da5f5528c22ffea4374e1aea66d4c030a2d483b06fb9715f59a3d3ee74ebbb4f5b2eaac53bb9fe8441c98de910218b53d73d8b6f7af
|
data/CHANGELOG.md
CHANGED
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
|
-
|
14
|
-
|
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
|
-
|
33
|
-
|
34
|
-
|
35
|
-
Neil Bartley
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
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
|
data/capistrano3-puma.gemspec
CHANGED
@@ -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
|
-
|
25
|
+
All plugins need to be explicitly installed with install_plugin.
|
26
26
|
Please see README.md
|
27
27
|
}
|
28
28
|
end
|
data/lib/capistrano/puma.rb
CHANGED
@@ -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
|
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'
|
@@ -9,7 +9,8 @@ namespace :puma do
|
|
9
9
|
#TODO
|
10
10
|
# cleanup
|
11
11
|
# add host name/ip
|
12
|
-
|
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
|
-
|
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
|
-
|
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
|
-
|
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
|
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-
|
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
|
95
|
-
|
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
|