capistrano-unicorn-edge 0.1.4 → 0.1.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 +11 -5
- data/{capistrano-unicorn.gemspec → capistrano-unicorn-edge.gemspec} +3 -3
- data/lib/capistrano/tasks/unicorn.cap +19 -2
- metadata +8 -8
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4dc96d50be88089308947a7034468db16be65b37
|
4
|
+
data.tar.gz: cd519fc2a7f8e6e773e5b0b69ca08ade9855e793
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 389ae4a775edde94e6db97e60fd96d053e36806a97038871a9431a60d8bb7c348b140947edaaa5bf395f87ccba1538da63cc275410b6db97a083791d51339a9c
|
7
|
+
data.tar.gz: 3b30e56046b20eae72eddaa8bcd2b2227d7fbb7424e8de260bcc12837e05c1ceab1bdf0f2049df071a07c2a68538703aa006ce32266b7c91b1ad398f99d5a6ee
|
data/README.md
CHANGED
@@ -6,10 +6,12 @@ Unicorn specific tasks for Capistrano 3.x
|
|
6
6
|
cap unicorn:start # Start unicorn
|
7
7
|
cap unicorn:stop # Stop unicorn gracefully (QUIT)
|
8
8
|
cap unicorn:shutdown # Stop unicorn immediately (TERM)
|
9
|
-
cap unicorn:restart # Restart unicorn
|
9
|
+
cap unicorn:restart # Restart unicorn
|
10
10
|
cap unicorn:restart_hup # Restart unicorn, when preload_app is false (HUP)
|
11
11
|
cap unicorn:restart_usr2 # Restart unicorn, when before_fork hook is set and preload_app is true (USR2)
|
12
12
|
cap unicorn:restart_usr2_quit # Restart unicorn, when before_fork hook is not set and preload_app is true (USR2 + QUIT)
|
13
|
+
cat unicorn:restart_quit # Restart unicorn, simple stop it gracefully and start again (QUIT)
|
14
|
+
cat unicorn:restart_term # Restart unicorn, simple stop it immediately and start it again (TERM)
|
13
15
|
cap unicorn:add_worker[count] # Add a worker (TTIN)
|
14
16
|
cap unicorn:remove_worker[count] # Remove a worker (TTOU)
|
15
17
|
cap unicorn:stop_workers # Stop all workers but keep the master running (WINCH)
|
@@ -52,12 +54,16 @@ set :unicorn_rack_env, :deployment # this is default
|
|
52
54
|
set :unicorn_restart_method, :restart_usr2 # this is default
|
53
55
|
```
|
54
56
|
|
55
|
-
Everything should work **out
|
57
|
+
Everything should work **out of the box** but you need to **set up unicorn's config**. (see an example `examples/unicorn.rb`).
|
56
58
|
|
57
59
|
There are three different ways to restart server:
|
58
|
-
|
59
|
-
|
60
|
-
|
60
|
+
* `:restart_hup` restarts all workers and therefore all code changes, makes sense if `preload_app` is false
|
61
|
+
* `:restart_usr2_quit` re-executes the running binary and stops previous instance in `:unicorn_restart_delay`
|
62
|
+
* `:restart_usr2` the same as above but `before_fork` hook has to be set, default and the best choice
|
63
|
+
* `:restart_quit` stops server gracefully and starts it again in `:unicorn_restart_delay`
|
64
|
+
* `:restart_term` stops server immediately and starts it again
|
65
|
+
|
66
|
+
Using methods which are based on `QUIT` signal can't be absolutely reliable
|
61
67
|
|
62
68
|
## Contributing
|
63
69
|
|
@@ -4,11 +4,11 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
|
4
4
|
|
5
5
|
Gem::Specification.new do |spec|
|
6
6
|
spec.name = "capistrano-unicorn-edge"
|
7
|
-
spec.version = "0.1.
|
7
|
+
spec.version = "0.1.5"
|
8
8
|
spec.authors = ["Alexander Menzhinsky"]
|
9
9
|
spec.email = ["amenzhinsky@gmail.com"]
|
10
10
|
spec.summary = %q{Unicorn support for Capistrano 3.x}
|
11
|
-
spec.description = %q{Unicorn support for Capistrano 3.x}
|
11
|
+
spec.description = %q{Unicorn support for Capistrano 3.x, some text to remove warnings}
|
12
12
|
spec.homepage = "https://github.com/amenzhinsky/capistrano-unicorn-edge"
|
13
13
|
spec.license = "MIT"
|
14
14
|
|
@@ -20,5 +20,5 @@ Gem::Specification.new do |spec|
|
|
20
20
|
spec.add_dependency 'capistrano', '~> 3.1'
|
21
21
|
|
22
22
|
spec.add_development_dependency "bundler", "~> 1.6"
|
23
|
-
spec.add_development_dependency "rake"
|
23
|
+
spec.add_development_dependency "rake", '~> 1.0'
|
24
24
|
end
|
@@ -36,7 +36,7 @@ namespace :unicorn do
|
|
36
36
|
end
|
37
37
|
end
|
38
38
|
|
39
|
-
desc 'Restart unicorn, when before_fork hook is set
|
39
|
+
desc 'Restart unicorn, when before_fork hook is set (USR2)'
|
40
40
|
task :restart_usr2 do
|
41
41
|
on roles(fetch(:unicorn_roles)) do
|
42
42
|
if unicorn_is_running?
|
@@ -47,7 +47,7 @@ namespace :unicorn do
|
|
47
47
|
end
|
48
48
|
end
|
49
49
|
|
50
|
-
desc 'Restart unicorn, when before_fork hook is not set
|
50
|
+
desc 'Restart unicorn, when before_fork hook is not set (USR2 + QUIT)'
|
51
51
|
task :restart_usr2_quit do
|
52
52
|
on roles(fetch(:unicorn_roles)) do
|
53
53
|
if unicorn_is_running?
|
@@ -64,6 +64,23 @@ namespace :unicorn do
|
|
64
64
|
end
|
65
65
|
end
|
66
66
|
|
67
|
+
desc 'Restart unicorn, simple stop it gracefully and start again (QUIT)'
|
68
|
+
task :restart_quit do
|
69
|
+
on roles(fetch(:unicorn_roles)) do
|
70
|
+
unicorn_send_signal(:QUIT) if unicorn_is_running?
|
71
|
+
execute :sleep, fetch(:unicorn_restart_delay)
|
72
|
+
unicorn_start
|
73
|
+
end
|
74
|
+
end
|
75
|
+
|
76
|
+
desc 'Restart unicorn, simple stop it immediately and start it again (TERM)'
|
77
|
+
task :restart_term do
|
78
|
+
on roles(fetch(:unicorn_roles)) do
|
79
|
+
unicorn_send_signal(:TERM) if unicorn_is_running?
|
80
|
+
unicorn_start
|
81
|
+
end
|
82
|
+
end
|
83
|
+
|
67
84
|
desc 'Add a worker (TTIN)'
|
68
85
|
task :add_worker, :count do |_, args|
|
69
86
|
on roles(fetch(:unicorn_roles)) do
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: capistrano-unicorn-edge
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Alexander Menzhinsky
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-05-
|
11
|
+
date: 2014-05-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: capistrano
|
@@ -42,17 +42,17 @@ dependencies:
|
|
42
42
|
name: rake
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
|
-
- - "
|
45
|
+
- - "~>"
|
46
46
|
- !ruby/object:Gem::Version
|
47
|
-
version: '0'
|
47
|
+
version: '1.0'
|
48
48
|
type: :development
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
|
-
- - "
|
52
|
+
- - "~>"
|
53
53
|
- !ruby/object:Gem::Version
|
54
|
-
version: '0'
|
55
|
-
description: Unicorn support for Capistrano 3.x
|
54
|
+
version: '1.0'
|
55
|
+
description: Unicorn support for Capistrano 3.x, some text to remove warnings
|
56
56
|
email:
|
57
57
|
- amenzhinsky@gmail.com
|
58
58
|
executables: []
|
@@ -64,7 +64,7 @@ files:
|
|
64
64
|
- LICENSE.txt
|
65
65
|
- README.md
|
66
66
|
- Rakefile
|
67
|
-
- capistrano-unicorn.gemspec
|
67
|
+
- capistrano-unicorn-edge.gemspec
|
68
68
|
- examples/unicorn.rb
|
69
69
|
- lib/capistrano/tasks/unicorn.cap
|
70
70
|
- lib/capistrano/unicorn.rb
|