sepastian-capistrano3-unicorn 0.5.0 → 0.5.1
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 +7 -0
- data/lib/capistrano/unicorn/utility.rb +16 -8
- data/lib/capistrano/unicorn/version.rb +1 -1
- metadata +15 -13
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5b09a6357848435fde3b73c9d029818d29cd75fc
|
4
|
+
data.tar.gz: 121ad6c75fd7b3c25ab861880ff004f1b66e5bc5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6f5a2dbf6f092e61755eee6e8e04a79b2b61665b4470a2eb7f81912cfa6fda37187785135de5c6c5af6366ab5deb0eafb26ed8929c47143115e5a83b616e804d
|
7
|
+
data.tar.gz: 94a46cefcc1373701ebe864793ba7e693dda2b1d056f2f1835fe2c51b81ce3a492ae4f33fb7a0941253b8669af1ecc4d54f18aae37bc0c4b94d1d34ae6b349c9
|
data/CHANGELOG.md
ADDED
@@ -40,7 +40,11 @@ module CapistranoUnicorn
|
|
40
40
|
# Check if a remote process exists using its pid file
|
41
41
|
#
|
42
42
|
def remote_process_exists?(pid_file)
|
43
|
-
|
43
|
+
begin
|
44
|
+
execute(*try_unicorn_user, 'kill', '-0', get_unicorn_pid) if within(fetch(:app_path)) { test('[', '-e', pid_file, ']') }
|
45
|
+
rescue SSHKit::Command::Failed => e
|
46
|
+
false
|
47
|
+
end
|
44
48
|
end
|
45
49
|
|
46
50
|
# Stale Unicorn process pid file
|
@@ -64,20 +68,24 @@ module CapistranoUnicorn
|
|
64
68
|
# Get unicorn master process PID (using the shell)
|
65
69
|
#
|
66
70
|
def get_unicorn_pid(pid_file=fetch(:unicorn_pid))
|
67
|
-
|
71
|
+
within fetch(:app_path) do
|
72
|
+
capture :cat, pid_file
|
73
|
+
end
|
68
74
|
end
|
69
75
|
|
70
76
|
# Get unicorn master (old) process PID
|
71
77
|
#
|
72
78
|
def get_old_unicorn_pid
|
73
|
-
|
79
|
+
within fetch(:app_path) do
|
80
|
+
get_unicorn_pid(old_unicorn_pid)
|
81
|
+
end
|
74
82
|
end
|
75
83
|
|
76
84
|
# Send a signal to a unicorn master processes
|
77
85
|
#
|
78
86
|
def unicorn_send_signal(signal, pid=get_unicorn_pid)
|
79
87
|
sig_prefix = Integer === signal ? '-' : '-s '
|
80
|
-
execute try_unicorn_user, 'kill', sig_prefix, signal, pid
|
88
|
+
execute *try_unicorn_user, 'kill', sig_prefix, signal, pid
|
81
89
|
end
|
82
90
|
|
83
91
|
# Run a command as the :unicorn_user user if :unicorn_user is a string.
|
@@ -85,9 +93,9 @@ module CapistranoUnicorn
|
|
85
93
|
#
|
86
94
|
def try_unicorn_user
|
87
95
|
if unicorn_user = fetch(:unicorn_user)
|
88
|
-
|
96
|
+
[:sudo, '-Eu', unicorn_user]
|
89
97
|
else
|
90
|
-
|
98
|
+
[]
|
91
99
|
end
|
92
100
|
end
|
93
101
|
|
@@ -113,7 +121,7 @@ module CapistranoUnicorn
|
|
113
121
|
fail "Config file for \"#{fetch(:unicorn_env)}\" environment was not found at either \"#{fetch(:unicorn_config_file_path)}\" or \"#{fetch(:unicorn_config_stage_file_path)}\""
|
114
122
|
end
|
115
123
|
|
116
|
-
if test(
|
124
|
+
if test('[', '-e', fetch(:unicorn_pid), ']')
|
117
125
|
if unicorn_is_running?
|
118
126
|
puts 'Unicorn is already running!'
|
119
127
|
return
|
@@ -126,7 +134,7 @@ module CapistranoUnicorn
|
|
126
134
|
|
127
135
|
within fetch(:app_path) do
|
128
136
|
with rails_env: fetch(:rails_env), bundle_gemfile: fetch(:bundle_gemfile) do
|
129
|
-
execute :bundle, 'exec', fetch(:unicorn_bin), '-c', unicorn_config_file_path, '-E', fetch(:unicorn_rack_env), '-D', fetch(:unicorn_options)
|
137
|
+
execute *try_unicorn_user, :bundle, 'exec', fetch(:unicorn_bin), '-c', unicorn_config_file_path, '-E', fetch(:unicorn_rack_env), '-D', fetch(:unicorn_options)
|
130
138
|
end
|
131
139
|
end
|
132
140
|
end
|
metadata
CHANGED
@@ -1,55 +1,55 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sepastian-capistrano3-unicorn
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.5.
|
4
|
+
version: 0.5.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sebastian Gassner, Dan Sosedoff
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-
|
11
|
+
date: 2014-06-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- -
|
17
|
+
- - ">="
|
18
18
|
- !ruby/object:Gem::Version
|
19
19
|
version: '0'
|
20
20
|
type: :development
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
|
-
- -
|
24
|
+
- - ">="
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: '0'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: unicorn
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
|
-
- -
|
31
|
+
- - ">="
|
32
32
|
- !ruby/object:Gem::Version
|
33
33
|
version: '0'
|
34
34
|
type: :development
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
|
-
- -
|
38
|
+
- - ">="
|
39
39
|
- !ruby/object:Gem::Version
|
40
40
|
version: '0'
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: capistrano
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
|
-
- - ~>
|
45
|
+
- - "~>"
|
46
46
|
- !ruby/object:Gem::Version
|
47
47
|
version: '3.0'
|
48
48
|
type: :runtime
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
|
-
- - ~>
|
52
|
+
- - "~>"
|
53
53
|
- !ruby/object:Gem::Version
|
54
54
|
version: '3.0'
|
55
55
|
description: Capistrano 3.x plugin that integrates Unicorn server tasks.
|
@@ -58,9 +58,10 @@ executables: []
|
|
58
58
|
extensions: []
|
59
59
|
extra_rdoc_files: []
|
60
60
|
files:
|
61
|
-
- .gitignore
|
62
|
-
- .rspec
|
63
|
-
- .travis.yml
|
61
|
+
- ".gitignore"
|
62
|
+
- ".rspec"
|
63
|
+
- ".travis.yml"
|
64
|
+
- CHANGELOG.md
|
64
65
|
- Gemfile
|
65
66
|
- LICENSE
|
66
67
|
- NEWS.md
|
@@ -87,12 +88,12 @@ require_paths:
|
|
87
88
|
- lib
|
88
89
|
required_ruby_version: !ruby/object:Gem::Requirement
|
89
90
|
requirements:
|
90
|
-
- -
|
91
|
+
- - ">="
|
91
92
|
- !ruby/object:Gem::Version
|
92
93
|
version: '0'
|
93
94
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
94
95
|
requirements:
|
95
|
-
- -
|
96
|
+
- - ">="
|
96
97
|
- !ruby/object:Gem::Version
|
97
98
|
version: '0'
|
98
99
|
requirements: []
|
@@ -102,3 +103,4 @@ signing_key:
|
|
102
103
|
specification_version: 4
|
103
104
|
summary: Unicorn integration for Capistrano 3.x
|
104
105
|
test_files: []
|
106
|
+
has_rdoc:
|