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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: de33c4866848767330e460a97d79f5f1d893a097
4
- data.tar.gz: 66c5d04a7c20407109c58d94f9ec753aae609f2a
2
+ SHA256:
3
+ metadata.gz: 2eadf4da0195248e5ce25a260423b32f4f71e7f54b6c0d396b7f5e1c40604aa3
4
+ data.tar.gz: e682b32cc48da4c50aebfaed702c7dd98a27b04f23747da96289807a32fa105a
5
5
  SHA512:
6
- metadata.gz: b6e2fb6a18bdeefcc701b4117f98a526f8b2480e2aa9c06aa2aa9fc8dcf593a427724a2daefe65e2eb880c2d6e15b321f9bc05cd7de5bdbda406274959499ba4
7
- data.tar.gz: 8e03edcb511a08082e157e07622ecbb49068d205a8715b6debb019df8f757bf8ea771fc511cf239daab109a40028888bda2d09cf08eb64d90d73494edaa4977a
6
+ metadata.gz: a2016c2552e53d2eb04e8615b094b7d52b868907db40e196b0b5fa2b13de0121b81f9921e7947d9758fd68a12377a8355de5da4556629e5d4d8b9aa3a3ff3cfd
7
+ data.tar.gz: eeccd0a9dea2b6a81ed1de9e4a72cf909b1a12e67f9aa06043f0c57e7f13fef8b536b41442eb190a35048a211ed8e8e53162307c5cef2ead88ab84f85f04c5fa
data/.gitignore CHANGED
@@ -16,3 +16,4 @@ test/tmp
16
16
  test/version_tmp
17
17
  tmp
18
18
  .idea
19
+ *.iml
@@ -1,5 +1,9 @@
1
1
  # Changelog
2
2
 
3
+ ## 1.0.3
4
+ - Add upstart support
5
+ - Fix monit service name
6
+
3
7
  ## 1.0.2
4
8
  - Fix deployment flow hooks
5
9
 
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
@@ -18,5 +18,5 @@ Gem::Specification.new do |spec|
18
18
  spec.require_paths = ['lib']
19
19
 
20
20
  spec.add_dependency 'capistrano', '>= 3.9.0'
21
- spec.add_dependency 'sidekiq', '>= 3.4'
21
+ spec.add_dependency 'sidekiq', '>= 3.4', "< 6.0"
22
22
  end
@@ -1,3 +1,3 @@
1
1
  module Capistrano
2
- SidekiqVERSION = '1.0.2'
2
+ SidekiqVERSION = '1.0.3'
3
3
  end
@@ -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, fetch(:application)) %>-sidekiq
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.2
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: 2018-04-12 00:00:00.000000000 Z
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
- rubyforge_project:
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