capistrano3-pushr 1.0.0 → 1.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/capistrano/pushr/version.rb +1 -1
- data/lib/capistrano/tasks/pushr.rake +19 -5
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3432dfb52d8f11cc07689bdb65e66b6decd49820
|
4
|
+
data.tar.gz: b2d66c54b3b98ca5793a92b4299c13bd56289584
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1b7f06642c8c6fd179b2ba691d9722ac7a77e9051f3b4a694d991e5d0cf8bcd6a50e3259c12776be2beed59c4f3e4862040880bcd0deae3a80ec5006b153e717
|
7
|
+
data.tar.gz: 61af1c1a4deda8451cfefb6efd09c0a35f3d4f99d811b3481bc34d4c45a06d16a784e95e34fc24fc89c97a59561892618ebbb35341ff375627aba127a5830295
|
@@ -3,6 +3,11 @@ namespace :load do
|
|
3
3
|
set :pushr_default_hooks, -> { true }
|
4
4
|
|
5
5
|
set :pushr_pid, -> { File.join shared_path, 'tmp', 'pids', 'pushr.pid' }
|
6
|
+
set :pushr_configuration, -> { File.join shared_path, 'config', 'pushr.yml' }
|
7
|
+
set :pushr_env, -> { fetch(:rack_env, fetch(:rails_env, fetch(:stage))) }
|
8
|
+
set :pushr_redis_host, -> { fetch(:redis_host, 'localhost') }
|
9
|
+
set :pushr_redis_port, -> { fetch(:redis_port, '6379') }
|
10
|
+
set :pushr_redis_namespace, -> { fetch(:redis_namespace, "pushr_#{fetch(:application)}_#{fetch(:stage)}") }
|
6
11
|
end
|
7
12
|
end
|
8
13
|
|
@@ -77,16 +82,16 @@ namespace :pushr do
|
|
77
82
|
"cat #{fetch(:pushr_pid)}"
|
78
83
|
end
|
79
84
|
|
80
|
-
def
|
85
|
+
def pushr_pid_file_exists?
|
81
86
|
test(*("[ -f #{fetch(:pushr_pid)} ]").split(' '))
|
82
87
|
end
|
83
88
|
|
84
|
-
def
|
85
|
-
|
89
|
+
def pushr_pid_process_exists?
|
90
|
+
pushr_pid_file_exists? && test(*("kill -0 `#{pid_command}`").split(' '))
|
86
91
|
end
|
87
92
|
|
88
93
|
def stop_pushr(signal)
|
89
|
-
return unless test("[ -d #{release_path} ]") &&
|
94
|
+
return unless test("[ -d #{release_path} ]") && pushr_pid_process_exists?
|
90
95
|
|
91
96
|
within release_path do
|
92
97
|
puts 'Stopping Pushr...'
|
@@ -97,8 +102,17 @@ namespace :pushr do
|
|
97
102
|
|
98
103
|
def start_pushr
|
99
104
|
within release_path do
|
105
|
+
args = []
|
106
|
+
args.push "--pid-file #{fetch(:pushr_pid)}"
|
107
|
+
args.push "--configuration #{fetch(:pushr_configuration)}"
|
108
|
+
args.push "--redis-host #{fetch(:pushr_redis_host)}"
|
109
|
+
args.push "--redis-port #{fetch(:pushr_redis_port)}"
|
110
|
+
args.push "--redis-namespace #{fetch(:pushr_redis_namespace)}"
|
111
|
+
|
100
112
|
puts 'Starting Pushr...'
|
101
|
-
|
113
|
+
with rack_env: fetch(:pushr_env) do
|
114
|
+
execute 'bundle', 'exec', 'pushr', args.compact.join(' ')
|
115
|
+
end
|
102
116
|
puts 'done!'
|
103
117
|
end
|
104
118
|
end
|