capistrano-sidekiq 0.3.7 → 0.3.8
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +3 -0
- data/lib/capistrano/sidekiq/version.rb +1 -1
- data/lib/capistrano/tasks/monit.cap +39 -1
- data/lib/capistrano/templates/sidekiq_monit.conf.erb +3 -2
- 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: 5dd1c2e79b129bc931e93fda45f0a71e40d7915e
|
4
|
+
data.tar.gz: 1681fdc2903aa89986f1c36d62b23ddfbfa0bb9b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c2b565dd956c2d410123847b1dfca4b87653ec18e64507518ed001008a739fa8060b38253d13f95239c068c6c867d2c21df75a132fe674eccd906fe3e8937cce
|
7
|
+
data.tar.gz: f7f3311f90b68b9d996e5051d8f3a4d3921b49f2036099da1eeea071a3b74a8175c8686842168078a44ff02494666f36ae033f0baf89880efb757ab479f0d441
|
data/README.md
CHANGED
@@ -54,6 +54,9 @@ There is a know bug that prevent sidekiq from starting when pty is true
|
|
54
54
|
set :pty, false
|
55
55
|
```
|
56
56
|
## Changelog
|
57
|
+
- 0.3.8:
|
58
|
+
* Update monit template: use su instead of sudo / permit all Sidekiq options @bensie
|
59
|
+
* Unmonitor monit while deploy @Saicheg
|
57
60
|
- 0.3.7:
|
58
61
|
* fix capistrano2 task @tribble
|
59
62
|
* Run Sidekiq as daemon from Monit @dpaluy
|
@@ -2,12 +2,26 @@ namespace :load do
|
|
2
2
|
task :defaults do
|
3
3
|
set :sidekiq_monit_conf_dir, -> { '/etc/monit/conf.d' }
|
4
4
|
set :monit_bin, -> { '/usr/bin/monit' }
|
5
|
+
set :sidekiq_monit_default_hooks, -> { true }
|
5
6
|
end
|
6
7
|
end
|
7
8
|
|
9
|
+
namespace :deploy do
|
10
|
+
before :starting, :check_sidekiq_monit_hooks do
|
11
|
+
if fetch(:sidekiq_default_hooks) && fetch(:sidekiq_monit_default_hooks)
|
12
|
+
invoke 'sidekiq:monit:add_default_hooks'
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
8
16
|
|
9
17
|
namespace :sidekiq do
|
10
18
|
namespace :monit do
|
19
|
+
|
20
|
+
task :add_default_hooks do
|
21
|
+
after 'deploy:check', 'sidekiq:monit:unmonitor'
|
22
|
+
after 'deploy:publishing', 'sidekiq:monit:monitor'
|
23
|
+
end
|
24
|
+
|
11
25
|
desc 'Config Sidekiq monit-service'
|
12
26
|
task :config do
|
13
27
|
on roles(fetch(:sidekiq_role)) do |role|
|
@@ -63,7 +77,31 @@ namespace :sidekiq do
|
|
63
77
|
end
|
64
78
|
|
65
79
|
def sidekiq_service_name(index=nil)
|
66
|
-
fetch(:sidekiq_service_name, "sidekiq_#{fetch(:application)}") + index.to_s
|
80
|
+
fetch(:sidekiq_service_name, "sidekiq_#{fetch(:application)}_#{fetch(:sidekiq_env)}") + index.to_s
|
81
|
+
end
|
82
|
+
|
83
|
+
def sidekiq_config
|
84
|
+
if fetch(:sidekiq_config)
|
85
|
+
"--config #{fetch(:sidekiq_config)}"
|
86
|
+
end
|
87
|
+
end
|
88
|
+
|
89
|
+
def sidekiq_concurrency
|
90
|
+
if fetch(:sidekiq_concurrency)
|
91
|
+
"--concurrency #{fetch(:sidekiq_concurrency)}"
|
92
|
+
end
|
93
|
+
end
|
94
|
+
|
95
|
+
def sidekiq_queues
|
96
|
+
Array(fetch(:sidekiq_queue)).map do |queue|
|
97
|
+
"--queue #{queue}"
|
98
|
+
end.join(' ')
|
99
|
+
end
|
100
|
+
|
101
|
+
def sidekiq_logfile
|
102
|
+
if fetch(:sidekiq_log)
|
103
|
+
"--logfile #{fetch(:sidekiq_log)}"
|
104
|
+
end
|
67
105
|
end
|
68
106
|
|
69
107
|
end
|
@@ -2,8 +2,9 @@
|
|
2
2
|
<% processes_pids.each_with_index do |pid_file, idx| %>
|
3
3
|
check process <%= sidekiq_service_name(idx) %>
|
4
4
|
with pidfile "<%= pid_file %>"
|
5
|
-
start program = "/
|
6
|
-
|
5
|
+
start program = "/bin/su - <%= @role.user %> -c 'cd <%= current_path %> && <%= SSHKit.config.command_map[:bundle] %> exec sidekiq <%= sidekiq_config %> --index <%= idx %> --pidfile <%= pid_file %> --environment <%= fetch(:sidekiq_env) %> <%= sidekiq_concurrency %> <%= sidekiq_logfile %> <%= sidekiq_queues %>'" with timeout 30 seconds
|
6
|
+
|
7
|
+
stop program = "/bin/su - <%= @role.user %> -c 'cd <%= current_path %> && <%= SSHKit.config.command_map[:bundle] %> exec sidekiqctl stop <%= pid_file %>'" with timeout <%= fetch(:sidekiq_timeout).to_i + 10 %> seconds
|
7
8
|
group <%= fetch(:sidekiq_monit_group, fetch(:application)) %>-sidekiq
|
8
9
|
|
9
10
|
<% end %>
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: capistrano-sidekiq
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.8
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Abdelkader Boudih
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-09-
|
11
|
+
date: 2014-09-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: capistrano
|