h2ocube_rails_rainbows 0.0.5 → 0.0.6
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 +4 -1
- data/h2ocube_rails_rainbows.gemspec +1 -1
- data/lib/capistrano/tasks/rainbows.cap +22 -11
- data/lib/generators/source/rainbows.rb.erb +0 -1
- 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: 4d29060644a2bd0d6b5cbb73f9441aa327e01b82
|
4
|
+
data.tar.gz: eec2f2b30206f7d0f97fb68b1f45e32e10269839
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6b9d77f1920e4d285a42c44eb4f3633c8037173c12e726922f91dd9ec5a4d1ca8a67564ef64529d258cd062761b0dfb7343d9d4d7769310a4a58eb1ee64ebb16
|
7
|
+
data.tar.gz: 0188f2b9aadbe40bea67cac0657e6c2983b65bb1a9ccd32802ebb929bce93c0a7b2918db6ed201dfeebc872be393124b92c46521ade7627d597f8164e1e20c3d
|
data/README.md
CHANGED
@@ -23,7 +23,10 @@ Or install it yourself as:
|
|
23
23
|
# Capfile
|
24
24
|
require 'capistrano/rainbows'
|
25
25
|
|
26
|
-
|
26
|
+
# config/deploy.rb
|
27
|
+
set :rainbows_bin, 'rainbows' # you can use `unicorn` replace `rainbows`
|
28
|
+
|
29
|
+
Rainbows specific tasks for Capistrano v3:
|
27
30
|
|
28
31
|
cap rainbows:start
|
29
32
|
cap rainbows:stop
|
@@ -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 = 'h2ocube_rails_rainbows'
|
7
|
-
spec.version = '0.0.
|
7
|
+
spec.version = '0.0.6'
|
8
8
|
spec.authors = ['Ben']
|
9
9
|
spec.email = ['ben@zfben.com']
|
10
10
|
spec.description = %q{Rainbows! helper}
|
@@ -1,9 +1,16 @@
|
|
1
1
|
namespace :rainbows do
|
2
|
+
set :rainbows_bin, fetch(:rainbows_bin, 'rainbows')
|
3
|
+
|
2
4
|
desc 'Start rainbows'
|
3
5
|
task :start do
|
4
6
|
on roles :app do
|
5
|
-
|
6
|
-
|
7
|
+
if !pid_exist?
|
8
|
+
within release_path do
|
9
|
+
execute :bundle, "exec #{fetch(:rainbows_bin)} -c config/#{fetch(:rainbows_bin)}.rb --listen 'unix://#{shared_path}/sockets/#{fetch(:rainbows_bin)}.sock' -E #{fetch(:stage)} -P '#{shared_path}/pids/#{fetch(:rainbows_bin)}.pid' -D"
|
10
|
+
info 'Rainbows started.'
|
11
|
+
end
|
12
|
+
else
|
13
|
+
info 'Rainbows is running, not need to start.'
|
7
14
|
end
|
8
15
|
end
|
9
16
|
end
|
@@ -11,20 +18,20 @@ namespace :rainbows do
|
|
11
18
|
desc 'Stop rainbows'
|
12
19
|
task :stop do
|
13
20
|
on roles :app do
|
14
|
-
pid_exist =
|
21
|
+
pid_exist = pid_exist?
|
15
22
|
times = 0
|
16
|
-
until pid_exist && times < 10 do
|
23
|
+
until !pid_exist && times < 10 do
|
17
24
|
within release_path do
|
18
|
-
execute "kill -s QUIT `cat #{shared_path}/pids
|
25
|
+
execute "kill -s QUIT `cat #{shared_path}/pids/#{fetch(:rainbows_bin)}.pid`;true"
|
19
26
|
end
|
20
|
-
sleep 1
|
21
|
-
pid_exist =
|
27
|
+
sleep times + 1
|
28
|
+
pid_exist = pid_exist?
|
22
29
|
times = times + 1
|
23
30
|
end
|
24
31
|
|
25
|
-
if times
|
32
|
+
if times >= 9
|
26
33
|
within shared_path do
|
27
|
-
execute :rm, 'pids
|
34
|
+
execute :rm, 'pids/#{fetch(:rainbows_bin)}.pid;true'
|
28
35
|
end
|
29
36
|
end
|
30
37
|
end
|
@@ -34,10 +41,10 @@ namespace :rainbows do
|
|
34
41
|
task :restart do
|
35
42
|
pid_exist = true
|
36
43
|
on roles :app do
|
37
|
-
pid_exist =
|
44
|
+
pid_exist = pid_exist?
|
38
45
|
if pid_exist
|
39
46
|
within release_path do
|
40
|
-
execute "kill -s USR2 `cat #{shared_path}/pids
|
47
|
+
execute "kill -s USR2 `cat #{shared_path}/pids/#{fetch(:rainbows_bin)}.pid`;true"
|
41
48
|
end
|
42
49
|
end
|
43
50
|
end
|
@@ -50,5 +57,9 @@ namespace :rainbows do
|
|
50
57
|
invoke 'rainbows:start'
|
51
58
|
end
|
52
59
|
|
60
|
+
def pid_exist?
|
61
|
+
'true' == capture("if [ -e #{shared_path}/pids/#{fetch(:rainbows_bin)}.pid ]; then echo 'true'; fi").strip
|
62
|
+
end
|
63
|
+
|
53
64
|
before 'deploy:published', 'rainbows:restart'
|
54
65
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: h2ocube_rails_rainbows
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ben
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-02-
|
11
|
+
date: 2014-02-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rainbows
|