capistrano-sidekiq 2.2.0 → 3.0.0.alpha.1
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/CHANGELOG.md +23 -2
- data/README.md +6 -66
- data/lib/capistrano/sidekiq/systemd.rb +38 -9
- data/lib/capistrano/sidekiq/version.rb +3 -1
- data/lib/capistrano/sidekiq.rb +56 -8
- data/lib/capistrano/tasks/systemd.rake +72 -219
- data/lib/capistrano/templates/sidekiq.service.capistrano.erb +45 -0
- data/lib/generators/capistrano/sidekiq/monit/templates/sidekiq_monit.conf.erb +7 -5
- metadata +13 -25
- data/.gitignore +0 -19
- data/.tool-versions +0 -1
- data/CONTRIBUTORS.md +0 -11
- data/Gemfile +0 -8
- data/Rakefile +0 -9
- data/capistrano-sidekiq.gemspec +0 -22
- data/lib/capistrano/sidekiq/helpers.rb +0 -60
- data/lib/capistrano/sidekiq/monit.rb +0 -19
- data/lib/capistrano/sidekiq/upstart.rb +0 -15
- data/lib/capistrano/tasks/monit.rake +0 -127
- data/lib/capistrano/tasks/upstart.rake +0 -104
- data/lib/generators/capistrano/sidekiq/systemd/templates/sidekiq.service.capistrano.erb +0 -70
- data/lib/generators/capistrano/sidekiq/upstart/templates/sidekiq.conf.erb +0 -78
- data/lib/generators/capistrano/sidekiq/upstart/templates/workers.conf.erb +0 -37
@@ -1,78 +0,0 @@
|
|
1
|
-
# /etc/init/sidekiq.conf - Sidekiq config | https://github.com/mperham/sidekiq/blob/master/examples/upstart/sidekiq.conf
|
2
|
-
|
3
|
-
# This example config should work with Ubuntu 12.04+. It
|
4
|
-
# allows you to manage multiple Sidekiq instances with
|
5
|
-
# Upstart, Ubuntu's native service management tool.
|
6
|
-
#
|
7
|
-
# See workers.conf for how to manage all Sidekiq instances at once.
|
8
|
-
#
|
9
|
-
# Save this config as /etc/init/sidekiq.conf then manage sidekiq with:
|
10
|
-
# sudo start <%= fetch(:sidekiq_service_unit_name) %> index=0
|
11
|
-
# sudo stop <%= fetch(:sidekiq_service_unit_name) %> index=0
|
12
|
-
# sudo status <%= fetch(:sidekiq_service_unit_name) %> index=0
|
13
|
-
#
|
14
|
-
# Hack Upstart's reload command to 'quiet' Sidekiq:
|
15
|
-
#
|
16
|
-
# sudo reload <%= fetch(:sidekiq_service_unit_name) %> index=0
|
17
|
-
#
|
18
|
-
# or use the service command:
|
19
|
-
# sudo service <%= fetch(:sidekiq_service_unit_name) %> {start,stop,restart,status}
|
20
|
-
#
|
21
|
-
|
22
|
-
description "Sidekiq for <%= "#{fetch(:application)} (#{fetch(:stage)})" %>"
|
23
|
-
|
24
|
-
# This script is not meant to start on bootup, workers.conf
|
25
|
-
# will start all sidekiq instances explicitly when it starts.
|
26
|
-
#start on runlevel [2345]
|
27
|
-
#stop on runlevel [06]
|
28
|
-
<% if sidekiq_user %>
|
29
|
-
|
30
|
-
# change to match your deployment user
|
31
|
-
setuid <%= sidekiq_user %>
|
32
|
-
setgid <%= sidekiq_user %>
|
33
|
-
env HOME=/home/<%= sidekiq_user %>
|
34
|
-
<% end %>
|
35
|
-
|
36
|
-
# Greatly reduce Ruby memory fragmentation and heap usage
|
37
|
-
# https://www.mikeperham.com/2018/04/25/taming-rails-memory-bloat/
|
38
|
-
env MALLOC_ARENA_MAX=2
|
39
|
-
|
40
|
-
respawn
|
41
|
-
respawn limit 3 30
|
42
|
-
|
43
|
-
# TERM is used when stopping sidekiq. Without declaring these as
|
44
|
-
# normal exit codes, it just respawns.
|
45
|
-
normal exit 0 TERM
|
46
|
-
|
47
|
-
# Older versions of Upstart might not support the reload command and need
|
48
|
-
# this commented out.
|
49
|
-
reload signal TSTP
|
50
|
-
|
51
|
-
# Upstart waits 5 seconds by default to kill a process. Increase timeout to
|
52
|
-
# give sidekiq process enough time to exit.
|
53
|
-
kill timeout 30
|
54
|
-
<% if num_workers %>
|
55
|
-
|
56
|
-
instance $index
|
57
|
-
<% end %>
|
58
|
-
script
|
59
|
-
# this script runs in /bin/sh by default
|
60
|
-
# respawn as bash so we can source in rbenv
|
61
|
-
exec /bin/bash <<'EOT'
|
62
|
-
# Pick your poison :) Or none if you're using a system wide installed Ruby.
|
63
|
-
# rbenv
|
64
|
-
# source /home/apps/.bash_profile
|
65
|
-
# OR
|
66
|
-
# source /home/apps/.profile
|
67
|
-
# OR system:
|
68
|
-
# source /etc/profile.d/rbenv.sh
|
69
|
-
#
|
70
|
-
# rvm
|
71
|
-
# source /home/apps/.rvm/scripts/rvm
|
72
|
-
|
73
|
-
# Logs out to /var/log/upstart/<%= fetch(:sidekiq_service_unit_name) %>.log by default
|
74
|
-
|
75
|
-
cd <%= File.join(fetch(:deploy_to), 'current') %>
|
76
|
-
exec <%= SSHKit.config.command_map[:bundle] %> exec sidekiq -e <%= fetch(:sidekiq_env) %> <%= sidekiq_config %> <%= sidekiq_concurrency %> <%= sidekiq_queues %>
|
77
|
-
EOT
|
78
|
-
end script
|
@@ -1,37 +0,0 @@
|
|
1
|
-
# /etc/init/workers.conf - manage a set of Sidekiqs | https://github.com/mperham/sidekiq/blob/master/examples/upstart/workers.conf
|
2
|
-
|
3
|
-
# This example config should work with Ubuntu 14.10 and below It
|
4
|
-
# allows you to manage multiple Sidekiq instances with
|
5
|
-
# Upstart, Ubuntu's native service management tool.
|
6
|
-
#
|
7
|
-
# See sidekiq.conf for how to manage a single Sidekiq instance.
|
8
|
-
#
|
9
|
-
# Use "stop workers" to stop all Sidekiq instances.
|
10
|
-
# Use "start workers" to start all instances.
|
11
|
-
# Use "restart workers" to restart all instances.
|
12
|
-
# Crazy, right?
|
13
|
-
#
|
14
|
-
|
15
|
-
description "manages the set of sidekiq processes"
|
16
|
-
|
17
|
-
# This starts upon bootup and stops on shutdown
|
18
|
-
start on runlevel [2345]
|
19
|
-
stop on runlevel [06]
|
20
|
-
|
21
|
-
# Set this to the number of Sidekiq processes you want
|
22
|
-
# to run on this machine
|
23
|
-
env NUM_WORKERS=2
|
24
|
-
|
25
|
-
pre-start script
|
26
|
-
for i in `seq 1 ${NUM_WORKERS}`
|
27
|
-
do
|
28
|
-
start sidekiq index=$i
|
29
|
-
done
|
30
|
-
end script
|
31
|
-
|
32
|
-
post-stop script
|
33
|
-
for i in `seq 1 ${NUM_WORKERS}`
|
34
|
-
do
|
35
|
-
stop sidekiq index=$i
|
36
|
-
done
|
37
|
-
end script
|