capistrano-racecar 1.0.1 → 1.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +14 -57
- data/lib/capistrano/tasks/racecar.rake +17 -1
- data/lib/capistrano/tasks/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2a9c7ac75e1864387212f0dcbbe5b822489bc74fc6ddd9f2e730abd050aab6a5
|
4
|
+
data.tar.gz: e985f82510e4f1167326c8305be265c880d70fab42699c217bf21a7cdf846cff
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 66c82f2079edbd66a9bd9f262f8099b9549c1f96482077a9f2eb3867f6c5ec0b7c8e6bdf7582d2401aaebce08f7b764080e5d3e8e64a55cceb89b5ebce1fbd8c
|
7
|
+
data.tar.gz: afa3df4685baff5f5839c4d31d135bcf1cc63ee8bb714ca12883dfbeb5d2552597cfd32c061f636ff25dfc427846a34e14c5b5e5b248e49265b4ec0ebce35cf8
|
data/README.md
CHANGED
@@ -1,12 +1,12 @@
|
|
1
|
-
[![Gem Version](https://badge.fury.io/rb/capistrano-
|
1
|
+
[![Gem Version](https://badge.fury.io/rb/capistrano-racecar.svg)](http://badge.fury.io/rb/capistrano-racecar)
|
2
2
|
|
3
|
-
# Capistrano::
|
3
|
+
# Capistrano::Racecar
|
4
4
|
|
5
5
|
Sidekiq integration for Capistrano
|
6
6
|
|
7
7
|
## Installation
|
8
8
|
|
9
|
-
gem 'capistrano-
|
9
|
+
gem 'capistrano-racecar', group: :development
|
10
10
|
|
11
11
|
And then execute:
|
12
12
|
|
@@ -15,77 +15,34 @@ And then execute:
|
|
15
15
|
|
16
16
|
## Usage
|
17
17
|
```ruby
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
install_plugin Capistrano::Sidekiq::Systemd
|
24
|
-
# or
|
25
|
-
install_plugin Capistrano::Sidekiq::Upstart # tests needed
|
26
|
-
# or
|
27
|
-
install_plugin Capistrano::Sidekiq::Monit # tests needed
|
18
|
+
# Capfile
|
19
|
+
|
20
|
+
require 'capistrano/racecar'
|
21
|
+
|
22
|
+
install_plugin Capistrano::Racecar
|
28
23
|
```
|
29
24
|
|
30
25
|
|
31
26
|
Configurable options, shown here with defaults:
|
32
27
|
|
33
28
|
```ruby
|
34
|
-
:
|
35
|
-
:
|
36
|
-
:
|
37
|
-
|
38
|
-
:
|
39
|
-
|
40
|
-
# sidekiq systemd options
|
41
|
-
:sidekiq_service_unit_name => 'sidekiq'
|
42
|
-
:sidekiq_service_unit_user => :user # :system
|
43
|
-
:sidekiq_enable_lingering => true
|
44
|
-
:sidekiq_lingering_user => nil
|
45
|
-
|
46
|
-
# sidekiq monit
|
47
|
-
:sidekiq_monit_templates_path => 'config/deploy/templates'
|
48
|
-
:sidekiq_monit_conf_dir => '/etc/monit/conf.d'
|
49
|
-
:sidekiq_monit_use_sudo => true
|
50
|
-
:monit_bin => '/usr/bin/monit'
|
51
|
-
:sidekiq_monit_default_hooks => true
|
52
|
-
:sidekiq_monit_group => nil
|
53
|
-
:sidekiq_service_name => "sidekiq_#{fetch(:application)}"
|
54
|
-
|
55
|
-
:sidekiq_user => nil #user to run sidekiq as
|
29
|
+
set_if_empty :racecar_task_path, 'config/racecar_task.yml'
|
30
|
+
set_if_empty :racecar_role, :app
|
31
|
+
set_if_empty :racecar_user, :system
|
32
|
+
set_if_empty :racecar_ctl, 'bundle exec racecarctl'
|
33
|
+
set_if_empty :racecar_pid_path, "#{fetch(:deploy_to)}/shared/tmp/pids"
|
56
34
|
```
|
57
35
|
|
58
|
-
## Known issues with Capistrano 3
|
59
|
-
|
60
|
-
There is a known bug that prevents sidekiq from starting when pty is true on Capistrano 3.
|
61
|
-
```ruby
|
62
|
-
set :pty, false
|
63
|
-
```
|
64
36
|
|
65
37
|
## Bundler
|
66
38
|
|
67
|
-
If you'd like to prepend `bundle exec` to your
|
39
|
+
If you'd like to prepend `bundle exec` to your racecar calls, modify the SSHKit command maps
|
68
40
|
in your deploy.rb file:
|
69
41
|
```ruby
|
70
42
|
SSHKit.config.command_map[:sidekiq] = "bundle exec sidekiq"
|
71
43
|
SSHKit.config.command_map[:sidekiqctl] = "bundle exec sidekiqctl"
|
72
44
|
```
|
73
45
|
|
74
|
-
|
75
|
-
## Customizing the monit sidekiq templates
|
76
|
-
|
77
|
-
If you need change some config in redactor, you can
|
78
|
-
|
79
|
-
```
|
80
|
-
bundle exec rails generate capistrano:sidekiq:monit:template
|
81
|
-
```
|
82
|
-
|
83
|
-
If your deploy user has no need in `sudo` for using monit, you can disable it as follows:
|
84
|
-
|
85
|
-
```ruby
|
86
|
-
set :sidekiq_monit_use_sudo, false
|
87
|
-
```
|
88
|
-
|
89
46
|
## Contributing
|
90
47
|
|
91
48
|
1. Fork it
|
@@ -1,7 +1,12 @@
|
|
1
1
|
git_plugin = self
|
2
2
|
|
3
|
-
namespace :
|
3
|
+
namespace :deploy do
|
4
|
+
before :starting, :check_racecar_hooks do
|
5
|
+
invoke 'racecar:add_hooks'
|
6
|
+
end
|
7
|
+
end
|
4
8
|
|
9
|
+
namespace :racecar do
|
5
10
|
def consumer_list
|
6
11
|
YAML.parse_file(fetch(:racecar_task_path)).to_ruby['tasks']
|
7
12
|
end
|
@@ -10,6 +15,12 @@ namespace :racecar do
|
|
10
15
|
"#{fetch(:racecar_pid_path)}/#{consumer_name.downcase}.pid"
|
11
16
|
end
|
12
17
|
|
18
|
+
task :add_hooks do
|
19
|
+
after 'deploy:updated', 'racecar:stop'
|
20
|
+
after 'deploy:published', 'racecar:start'
|
21
|
+
after 'deploy:failed', 'racecar:restart'
|
22
|
+
end
|
23
|
+
|
13
24
|
desc 'Test'
|
14
25
|
task :test do
|
15
26
|
on roles(fetch(:racecar_role)) do |role|
|
@@ -49,5 +60,10 @@ namespace :racecar do
|
|
49
60
|
end
|
50
61
|
end
|
51
62
|
|
63
|
+
task :restart do
|
64
|
+
invoke! 'racecar:stop'
|
65
|
+
invoke! 'racecar:start'
|
66
|
+
end
|
67
|
+
|
52
68
|
end
|
53
69
|
|