sepastian-capistrano3-unicorn 0.3.0 → 0.3.2
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 +7 -0
- data/README.md +7 -6
- data/lib/capistrano/tasks/unicorn.cap +5 -6
- data/lib/capistrano/unicorn/utility.rb +3 -2
- data/lib/capistrano/unicorn/version.rb +1 -1
- metadata +11 -19
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: fbaccaa6fb6582beeed06e5e627e4b058621ba64
|
4
|
+
data.tar.gz: c20b3a340555785bfad1ed97d1c166dd3c2f38d1
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: f3acb9a1d3a9d3040530f951e6c7a35e1d3ba29bf5e7386c152fc16f04d00fba4d2f6707a9bf3c8532d1b284bae782ea983f35177c55b85f8c03c7dae8cf083a
|
7
|
+
data.tar.gz: d080c5ef285ac1260b7aaeb56d8abdefdee610cc017d4e289794bcaba1e51d23547b69cacf6dacaede007d185219f3487f88c2b1ce1716790209196eae1f6cb1
|
data/README.md
CHANGED
@@ -1,14 +1,15 @@
|
|
1
1
|
# Capistrano Unicorn
|
2
2
|
|
3
|
-
Capistrano plugin that integrates Unicorn tasks into capistrano deployment script.
|
3
|
+
Capistrano 3.x plugin that integrates Unicorn tasks into capistrano deployment script.
|
4
|
+
Taken from https://github.com/sosedoff/capistrano-unicorn and adapted to work with Capistrano 3.x.
|
5
|
+
|
6
|
+
**Note: this code is not well tested, if anything fails, please report it. Use at your own risk.**
|
4
7
|
|
5
8
|
**Developers:** Please consider contributing your forked changes, or opening an
|
6
9
|
issue if there is no existing relevant one. There are a lot of forks--we'd love
|
7
10
|
to reabsorb some of the issues/solutions the community has encountered.
|
8
11
|
|
9
|
-
[](http://badge.fury.io/rb/capistrano-unicorn)
|
11
|
-
[](https://codeclimate.com/github/sosedoff/capistrano-unicorn)
|
12
|
+
[](http://badge.fury.io/rb/sepastian-capistrano3-unicorn)
|
12
13
|
|
13
14
|
## Usage
|
14
15
|
|
@@ -20,14 +21,14 @@ Add the library to your `Gemfile`:
|
|
20
21
|
|
21
22
|
```ruby
|
22
23
|
group :development do
|
23
|
-
gem '
|
24
|
+
gem 'sepastian-capistrano3-unicorn', :require => false
|
24
25
|
end
|
25
26
|
```
|
26
27
|
|
27
28
|
And load it into your deployment script `config/deploy.rb`:
|
28
29
|
|
29
30
|
```ruby
|
30
|
-
require 'capistrano
|
31
|
+
require 'capistrano/unicorn'
|
31
32
|
```
|
32
33
|
|
33
34
|
Add unicorn restart task hook:
|
@@ -31,7 +31,6 @@ namespace :load do
|
|
31
31
|
# If you find the following confusing, try running 'cap unicorn:show_vars' -
|
32
32
|
# it might help :-)
|
33
33
|
set :app_path , Proc.new{ File.join(current_path, fetch(:app_subdir)) }
|
34
|
-
set :bundle_gemfile , Proc.new{ File.join(fetch(:app_path), 'Gemfile') }
|
35
34
|
set :unicorn_config_path , Proc.new{ File.join(fetch(:app_path), fetch(:unicorn_config_rel_path)) }
|
36
35
|
set :unicorn_config_file_path , Proc.new{ File.join(fetch(:app_path), fetch(:unicorn_config_rel_file_path)) }
|
37
36
|
set :unicorn_config_stage_file_path, Proc.new{ File.join(fetch(:app_path), fetch(:unicorn_config_stage_rel_file_path)) }
|
@@ -77,7 +76,6 @@ namespace :unicorn do
|
|
77
76
|
# Absolute paths
|
78
77
|
app_path #{fetch :app_path}
|
79
78
|
unicorn_pid #{fetch :unicorn_pid}
|
80
|
-
bundle_gemfile #{fetch :bundle_gemfile}
|
81
79
|
unicorn_config_path #{fetch :unicorn_config_path}
|
82
80
|
unicorn_config_file_path #{fetch :unicorn_config_file_path}
|
83
81
|
unicorn_config_stage_file_path
|
@@ -89,6 +87,7 @@ namespace :unicorn do
|
|
89
87
|
desc 'Start Unicorn master process'
|
90
88
|
task :start do
|
91
89
|
on roles unicorn_roles, :except => {:no_release => true} do
|
90
|
+
|
92
91
|
execute start_unicorn
|
93
92
|
end
|
94
93
|
end
|
@@ -125,8 +124,8 @@ namespace :unicorn do
|
|
125
124
|
|
126
125
|
desc 'Reload Unicorn'
|
127
126
|
task :reload do
|
128
|
-
on roles
|
129
|
-
execute "if #{unicorn_is_running?}; then #{unicorn_send_signal('HUP')}; else #{start_unicorn}
|
127
|
+
on roles unicorn_roles, :except => {:no_release => true} do
|
128
|
+
execute "if #{unicorn_is_running?}; then #{unicorn_send_signal('HUP')}; else #{start_unicorn} fi;"
|
130
129
|
# run <<-END
|
131
130
|
# if #{unicorn_is_running?}; then
|
132
131
|
# echo "Reloading Unicorn...";
|
@@ -140,7 +139,7 @@ namespace :unicorn do
|
|
140
139
|
|
141
140
|
desc 'Add a new worker'
|
142
141
|
task :add_worker do
|
143
|
-
on roles
|
142
|
+
on roles unicorn_roles, :except => {:no_release => true} do
|
144
143
|
execute "if #{unicorn_is_running?}; then #{unicorn_send_signal('TTIN')}; fi;"
|
145
144
|
# run <<-END
|
146
145
|
# if #{unicorn_is_running?}; then
|
@@ -155,7 +154,7 @@ namespace :unicorn do
|
|
155
154
|
|
156
155
|
desc 'Remove amount of workers'
|
157
156
|
task :remove_worker do
|
158
|
-
on roles
|
157
|
+
on roles unicorn_roles, :except => {:no_release => true} do
|
159
158
|
execute "if #{unicorn_is_running?}; then #{unicorn_send_signal('TTOU')}; fi;"
|
160
159
|
# run <<-END
|
161
160
|
# if #{unicorn_is_running?}; then
|
@@ -55,7 +55,7 @@ module CapistranoUnicorn
|
|
55
55
|
# Check if a remote process exists using its pid file
|
56
56
|
#
|
57
57
|
def remote_process_exists?(pid_file)
|
58
|
-
"[ -e #{pid_file} ] && #{
|
58
|
+
"[ -e #{pid_file} ] && #{unicorn_send_signal(0, get_unicorn_pid(pid_file))} > /dev/null 2>&1"
|
59
59
|
end
|
60
60
|
|
61
61
|
# Stale Unicorn process pid file
|
@@ -91,7 +91,8 @@ module CapistranoUnicorn
|
|
91
91
|
# Send a signal to a unicorn master processes
|
92
92
|
#
|
93
93
|
def unicorn_send_signal(signal, pid=get_unicorn_pid)
|
94
|
-
|
94
|
+
sig_prefix = Integer === signal ? '-' : '-s '
|
95
|
+
"#{try_unicorn_user} kill #{sig_prefix}#{signal} #{pid}"
|
95
96
|
end
|
96
97
|
|
97
98
|
# Run a command as the :unicorn_user user if :unicorn_user is a string.
|
metadata
CHANGED
@@ -1,52 +1,46 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sepastian-capistrano3-unicorn
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
5
|
-
prerelease:
|
4
|
+
version: 0.3.2
|
6
5
|
platform: ruby
|
7
6
|
authors:
|
8
7
|
- Sebastian Gassner, Dan Sosedoff
|
9
8
|
autorequire:
|
10
9
|
bindir: bin
|
11
10
|
cert_chain: []
|
12
|
-
date:
|
11
|
+
date: 2014-01-13 00:00:00.000000000 Z
|
13
12
|
dependencies:
|
14
13
|
- !ruby/object:Gem::Dependency
|
15
14
|
name: rake
|
16
15
|
requirement: !ruby/object:Gem::Requirement
|
17
|
-
none: false
|
18
16
|
requirements:
|
19
|
-
- -
|
17
|
+
- - '>='
|
20
18
|
- !ruby/object:Gem::Version
|
21
19
|
version: '0'
|
22
20
|
type: :development
|
23
21
|
prerelease: false
|
24
22
|
version_requirements: !ruby/object:Gem::Requirement
|
25
|
-
none: false
|
26
23
|
requirements:
|
27
|
-
- -
|
24
|
+
- - '>='
|
28
25
|
- !ruby/object:Gem::Version
|
29
26
|
version: '0'
|
30
27
|
- !ruby/object:Gem::Dependency
|
31
28
|
name: unicorn
|
32
29
|
requirement: !ruby/object:Gem::Requirement
|
33
|
-
none: false
|
34
30
|
requirements:
|
35
|
-
- -
|
31
|
+
- - '>='
|
36
32
|
- !ruby/object:Gem::Version
|
37
33
|
version: '0'
|
38
34
|
type: :development
|
39
35
|
prerelease: false
|
40
36
|
version_requirements: !ruby/object:Gem::Requirement
|
41
|
-
none: false
|
42
37
|
requirements:
|
43
|
-
- -
|
38
|
+
- - '>='
|
44
39
|
- !ruby/object:Gem::Version
|
45
40
|
version: '0'
|
46
41
|
- !ruby/object:Gem::Dependency
|
47
42
|
name: capistrano
|
48
43
|
requirement: !ruby/object:Gem::Requirement
|
49
|
-
none: false
|
50
44
|
requirements:
|
51
45
|
- - ~>
|
52
46
|
- !ruby/object:Gem::Version
|
@@ -54,7 +48,6 @@ dependencies:
|
|
54
48
|
type: :runtime
|
55
49
|
prerelease: false
|
56
50
|
version_requirements: !ruby/object:Gem::Requirement
|
57
|
-
none: false
|
58
51
|
requirements:
|
59
52
|
- - ~>
|
60
53
|
- !ruby/object:Gem::Version
|
@@ -87,27 +80,26 @@ files:
|
|
87
80
|
homepage: https://github.com/sepastian/capistrano-unicorn
|
88
81
|
licenses:
|
89
82
|
- MIT
|
83
|
+
metadata: {}
|
90
84
|
post_install_message:
|
91
85
|
rdoc_options: []
|
92
86
|
require_paths:
|
93
87
|
- lib
|
94
88
|
required_ruby_version: !ruby/object:Gem::Requirement
|
95
|
-
none: false
|
96
89
|
requirements:
|
97
|
-
- -
|
90
|
+
- - '>='
|
98
91
|
- !ruby/object:Gem::Version
|
99
92
|
version: '0'
|
100
93
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
101
|
-
none: false
|
102
94
|
requirements:
|
103
|
-
- -
|
95
|
+
- - '>='
|
104
96
|
- !ruby/object:Gem::Version
|
105
97
|
version: '0'
|
106
98
|
requirements: []
|
107
99
|
rubyforge_project:
|
108
|
-
rubygems_version: 1.
|
100
|
+
rubygems_version: 2.1.11
|
109
101
|
signing_key:
|
110
|
-
specification_version:
|
102
|
+
specification_version: 4
|
111
103
|
summary: Unicorn integration for Capistrano 3.x
|
112
104
|
test_files: []
|
113
105
|
has_rdoc:
|