capistrano-sidekiq 1.0.2 → 1.0.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/.gitignore +1 -0
- data/CHANGELOG.md +4 -0
- data/README.md +20 -1
- data/capistrano-sidekiq.gemspec +1 -1
- data/lib/capistrano/sidekiq/version.rb +1 -1
- data/lib/capistrano/tasks/monit.rake +1 -1
- data/lib/capistrano/tasks/sidekiq.rake +7 -0
- data/lib/generators/capistrano/sidekiq/monit/templates/sidekiq_monit.conf.erb +1 -1
- metadata +9 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 2eadf4da0195248e5ce25a260423b32f4f71e7f54b6c0d396b7f5e1c40604aa3
|
4
|
+
data.tar.gz: e682b32cc48da4c50aebfaed702c7dd98a27b04f23747da96289807a32fa105a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a2016c2552e53d2eb04e8615b094b7d52b868907db40e196b0b5fa2b13de0121b81f9921e7947d9758fd68a12377a8355de5da4556629e5d4d8b9aa3a3ff3cfd
|
7
|
+
data.tar.gz: eeccd0a9dea2b6a81ed1de9e4a72cf909b1a12e67f9aa06043f0c57e7f13fef8b536b41442eb190a35048a211ed8e8e53162307c5cef2ead88ab84f85f04c5fa
|
data/.gitignore
CHANGED
data/CHANGELOG.md
CHANGED
data/README.md
CHANGED
@@ -1,5 +1,4 @@
|
|
1
1
|
[![Gem Version](https://badge.fury.io/rb/capistrano-sidekiq.svg)](http://badge.fury.io/rb/capistrano-sidekiq)
|
2
|
-
[![Dependency Status](https://gemnasium.com/seuros/capistrano-sidekiq.svg)](https://gemnasium.com/seuros/capistrano-sidekiq)
|
3
2
|
|
4
3
|
# Capistrano::Sidekiq
|
5
4
|
|
@@ -85,6 +84,7 @@ This example should boot the first process with the queue `high` and the second
|
|
85
84
|
and `low`:
|
86
85
|
|
87
86
|
```ruby
|
87
|
+
set :sidekiq_processes, 2
|
88
88
|
set :sidekiq_options_per_process, ["--queue high", "--queue default --queue low"]
|
89
89
|
```
|
90
90
|
|
@@ -108,6 +108,12 @@ Set init system to systemd in the cap deploy config:
|
|
108
108
|
set :init_system, :systemd
|
109
109
|
```
|
110
110
|
|
111
|
+
Enable lingering for systemd user account
|
112
|
+
|
113
|
+
```
|
114
|
+
loginctl enable-linger USERACCOUNT
|
115
|
+
```
|
116
|
+
|
111
117
|
Install systemd.service template file and enable the service with:
|
112
118
|
|
113
119
|
```
|
@@ -120,6 +126,19 @@ Default name for the service file is `sidekiq-stage.service`. This can be change
|
|
120
126
|
set :service_unit_name, "sidekiq-#{fetch(:application)}-#{fetch(:stage)}.service"
|
121
127
|
```
|
122
128
|
|
129
|
+
## Integration with upstart
|
130
|
+
|
131
|
+
Set init system to upstart in the cap deploy config:
|
132
|
+
|
133
|
+
```ruby
|
134
|
+
set :init_system, :upstart
|
135
|
+
```
|
136
|
+
|
137
|
+
Set upstart service name:
|
138
|
+
```ruby
|
139
|
+
set :upstart_service_name, 'sidekiq'
|
140
|
+
```
|
141
|
+
|
123
142
|
## Customizing the monit sidekiq templates
|
124
143
|
|
125
144
|
If you need change some config in redactor, you can
|
data/capistrano-sidekiq.gemspec
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
namespace :load do
|
2
2
|
task :defaults do
|
3
3
|
set :sidekiq_monit_conf_dir, '/etc/monit/conf.d'
|
4
|
-
set :sidekiq_monit_conf_file, "#{sidekiq_service_name}.conf"
|
4
|
+
set :sidekiq_monit_conf_file, -> { "#{sidekiq_service_name}.conf" }
|
5
5
|
set :sidekiq_monit_use_sudo, true
|
6
6
|
set :monit_bin, '/usr/bin/monit'
|
7
7
|
set :sidekiq_monit_default_hooks, true
|
@@ -20,6 +20,7 @@ namespace :load do
|
|
20
20
|
set :init_system, -> { nil }
|
21
21
|
# systemd integration
|
22
22
|
set :service_unit_name, "sidekiq-#{fetch(:stage)}.service"
|
23
|
+
set :upstart_service_name, "sidekiq"
|
23
24
|
end
|
24
25
|
end
|
25
26
|
|
@@ -44,6 +45,8 @@ namespace :sidekiq do
|
|
44
45
|
case fetch(:init_system)
|
45
46
|
when :systemd
|
46
47
|
execute :systemctl, "--user", "reload", fetch(:service_unit_name), raise_on_non_zero_exit: false
|
48
|
+
when :upstart
|
49
|
+
sudo :service, fetch(:upstart_service_name), :reload
|
47
50
|
else
|
48
51
|
if test("[ -d #{release_path} ]")
|
49
52
|
each_process_with_index(reverse: true) do |pid_file, _idx|
|
@@ -64,6 +67,8 @@ namespace :sidekiq do
|
|
64
67
|
case fetch(:init_system)
|
65
68
|
when :systemd
|
66
69
|
execute :systemctl, "--user", "stop", fetch(:service_unit_name)
|
70
|
+
when :upstart
|
71
|
+
sudo :service, fetch(:upstart_service_name), :stop
|
67
72
|
else
|
68
73
|
if test("[ -d #{release_path} ]")
|
69
74
|
each_process_with_index(reverse: true) do |pid_file, _idx|
|
@@ -84,6 +89,8 @@ namespace :sidekiq do
|
|
84
89
|
case fetch(:init_system)
|
85
90
|
when :systemd
|
86
91
|
execute :systemctl, '--user', 'start', fetch(:service_unit_name)
|
92
|
+
when :upstart
|
93
|
+
sudo :service, fetch(:upstart_service_name), :start
|
87
94
|
else
|
88
95
|
each_process_with_index do |pid_file, idx|
|
89
96
|
unless pid_file_exists?(pid_file) && process_exists?(pid_file)
|
@@ -5,6 +5,6 @@ check process <%= sidekiq_service_name(idx) %>
|
|
5
5
|
start program = "/bin/su - <%= sidekiq_user(@role) %> -c 'cd <%= current_path %> && <%= SSHKit.config.command_map[:sidekiq] %> <%= sidekiq_config %> --index <%= idx %> --pidfile <%= pid_file %> --environment <%= fetch(:sidekiq_env) %> <%= sidekiq_concurrency %> <%= sidekiq_logfile %> <%= sidekiq_require %> <%= sidekiq_queues %> <%= sidekiq_options_per_process[idx] %> -d'" with timeout 30 seconds
|
6
6
|
|
7
7
|
stop program = "/bin/su - <%= sidekiq_user(@role) %> -c 'cd <%= current_path %> && <%= SSHKit.config.command_map[:sidekiqctl] %> stop <%= pid_file %>'" with timeout <%= fetch(:sidekiq_timeout).to_i + 10 %> seconds
|
8
|
-
group <%= fetch(:sidekiq_monit_group
|
8
|
+
group <%= fetch(:sidekiq_monit_group) || fetch(:application) %>-sidekiq
|
9
9
|
|
10
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: 1.0.
|
4
|
+
version: 1.0.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Abdelkader Boudih
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2019-09-02 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: capistrano
|
@@ -31,6 +31,9 @@ dependencies:
|
|
31
31
|
- - ">="
|
32
32
|
- !ruby/object:Gem::Version
|
33
33
|
version: '3.4'
|
34
|
+
- - "<"
|
35
|
+
- !ruby/object:Gem::Version
|
36
|
+
version: '6.0'
|
34
37
|
type: :runtime
|
35
38
|
prerelease: false
|
36
39
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -38,6 +41,9 @@ dependencies:
|
|
38
41
|
- - ">="
|
39
42
|
- !ruby/object:Gem::Version
|
40
43
|
version: '3.4'
|
44
|
+
- - "<"
|
45
|
+
- !ruby/object:Gem::Version
|
46
|
+
version: '6.0'
|
41
47
|
description: Sidekiq integration for Capistrano
|
42
48
|
email:
|
43
49
|
- terminale@gmail.com
|
@@ -81,8 +87,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
81
87
|
- !ruby/object:Gem::Version
|
82
88
|
version: '0'
|
83
89
|
requirements: []
|
84
|
-
|
85
|
-
rubygems_version: 2.6.14
|
90
|
+
rubygems_version: 3.0.3
|
86
91
|
signing_key:
|
87
92
|
specification_version: 4
|
88
93
|
summary: Sidekiq integration for Capistrano
|