cap-puma 0.0.4 → 0.0.5
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/README.md +14 -1
- data/cap-puma.gemspec +1 -1
- data/lib/capistrano/tasks/puma.rake +31 -7
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 077da3f13fdcb588d446c659932b1f1e156edec6
|
4
|
+
data.tar.gz: 4573f44f66fec0dcb1faea203f1b22e5c700acc8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f958f05bc40eb82f8d88e744a0510a1113883a22f4d1ac137967921cf657a027bed5fb215f1d52f2b31ff6aa9fd63abf1892eca718f51ad9f9080adb66f7d78e
|
7
|
+
data.tar.gz: cc7bc2ebb876da6ab511d9c74630432fb470210b2b228ca7756c3a95a687c25cb90b37cf1ed0197ab303b4bdc717179a349a00930e48d895f7ee6209557cd6ba
|
data/README.md
CHANGED
@@ -7,9 +7,12 @@ These tasks have been taken directly from the puma gem and upgraded to Rake
|
|
7
7
|
Includes the following commands;
|
8
8
|
|
9
9
|
- `cap puma:start`
|
10
|
-
- `cap puma:
|
10
|
+
- `cap puma:restart`
|
11
11
|
- `cap puma:phased_restart`
|
12
12
|
- `cap puma:stop`
|
13
|
+
- `cap puma:upstart:start`
|
14
|
+
- `cap puma:upstart:restart`
|
15
|
+
- `cap puma:upstart:stop`
|
13
16
|
|
14
17
|
## Installation
|
15
18
|
|
@@ -23,12 +26,22 @@ And then execute:
|
|
23
26
|
$ bundle --binstubs
|
24
27
|
$ cap install
|
25
28
|
|
29
|
+
|
30
|
+
To use upstart to manage the puma processes follow the instruction
|
31
|
+
https://github.com/puma/puma/tree/master/tools/jungle/upstart
|
32
|
+
|
26
33
|
## Usage
|
27
34
|
|
28
35
|
Add the following line to your Capfile
|
29
36
|
|
30
37
|
require 'capistrano/puma'
|
31
38
|
|
39
|
+
to use upstart to control the puma daemon set :puma_upstart to true in your
|
40
|
+
environment file
|
41
|
+
|
42
|
+
set :puma_upstart, true
|
43
|
+
|
44
|
+
|
32
45
|
## Contributing
|
33
46
|
|
34
47
|
1. Fork it
|
data/cap-puma.gemspec
CHANGED
@@ -4,7 +4,7 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
|
4
4
|
|
5
5
|
Gem::Specification.new do |spec|
|
6
6
|
spec.name = "cap-puma"
|
7
|
-
spec.version = '0.0.
|
7
|
+
spec.version = '0.0.5'
|
8
8
|
spec.authors = ["John D'Agostino"]
|
9
9
|
spec.email = ["john.dagostino@gmail.com"]
|
10
10
|
spec.description = %q{Capistrano v3 Rake tasks for Puma}
|
@@ -8,16 +8,39 @@ namespace :puma do
|
|
8
8
|
set :puma_role, fetch(:puma_role, :app)
|
9
9
|
end
|
10
10
|
|
11
|
+
namespace :upstart do
|
12
|
+
desc 'Start puma using upstart'
|
13
|
+
task :start => [:defaults] do
|
14
|
+
on roles fetch(:puma_role) do
|
15
|
+
execute :service, 'puma', 'start', "app=#{current_path}"
|
16
|
+
end
|
17
|
+
end
|
18
|
+
|
19
|
+
desc 'Restart puma using upstart'
|
20
|
+
task :restart => [:defaults] do
|
21
|
+
on roles fetch(:puma_role) do
|
22
|
+
execute :service, 'puma', 'restart', "app=#{current_path}"
|
23
|
+
end
|
24
|
+
end
|
25
|
+
|
26
|
+
desc 'Stop puma using upstart'
|
27
|
+
task :stop => [:defaults] do
|
28
|
+
on roles fetch(:puma_role) do
|
29
|
+
execute :service, 'puma', 'stop', "app=#{current_path}"
|
30
|
+
end
|
31
|
+
end
|
32
|
+
end
|
33
|
+
|
11
34
|
# https://github.com/leehambley/sshkit/blob/master/EXAMPLES.md#run-a-command-without-it-being-command-mapped
|
12
|
-
def execute_current_path(cmd)
|
13
|
-
execute "cd
|
35
|
+
def execute_current_path(*cmd)
|
36
|
+
send(:execute, *["cd", current_path.to_s, "&&"].concat(cmd))
|
14
37
|
end
|
15
38
|
|
16
39
|
desc 'Start puma'
|
17
40
|
task :start => [:defaults] do
|
18
41
|
on roles fetch(:puma_role) do
|
19
42
|
within current_path do
|
20
|
-
execute_current_path(
|
43
|
+
execute_current_path(fetch(:puma_cmd), start_options)
|
21
44
|
end
|
22
45
|
end
|
23
46
|
end
|
@@ -33,7 +56,7 @@ namespace :puma do
|
|
33
56
|
task :stop => [:defaults] do
|
34
57
|
on roles fetch(:puma_role) do
|
35
58
|
within current_path do
|
36
|
-
execute_current_path(
|
59
|
+
execute_current_path(fetch(:pumactl_cmd), "-S", state_path, "stop")
|
37
60
|
end
|
38
61
|
end
|
39
62
|
end
|
@@ -43,7 +66,7 @@ namespace :puma do
|
|
43
66
|
on roles fetch(:puma_role) do
|
44
67
|
within current_path do
|
45
68
|
begin
|
46
|
-
execute_current_path(
|
69
|
+
execute_current_path(fetch(:pumactl_cmd), "-S", state_path, "restart")
|
47
70
|
rescue SSHKit::StandardError
|
48
71
|
Rake::Task["puma:start"].invoke
|
49
72
|
end
|
@@ -55,7 +78,7 @@ namespace :puma do
|
|
55
78
|
task :phased_restart => [:defaults] do
|
56
79
|
on roles fetch(:puma_role) do
|
57
80
|
within current_path do
|
58
|
-
execute_current_path(
|
81
|
+
execute_current_path(fetch(:pumactl_cmd), "-S", state_path, "phased-restart")
|
59
82
|
end
|
60
83
|
end
|
61
84
|
end
|
@@ -92,6 +115,7 @@ namespace :puma do
|
|
92
115
|
config
|
93
116
|
end
|
94
117
|
|
95
|
-
after 'deploy:finishing', 'puma:restart'
|
118
|
+
# after 'deploy:finishing', 'puma:upstart:restart'
|
119
|
+
# after 'deploy:finishing', 'puma:restart'
|
96
120
|
end
|
97
121
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cap-puma
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- John D'Agostino
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-
|
11
|
+
date: 2013-11-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|