capistrano-karafka 1.0.0 → 1.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +0 -1
- data/CHANGELOG.md +6 -0
- data/Gemfile.lock +133 -0
- data/README.md +52 -5
- data/capistrano-karafka.gemspec +3 -5
- data/lib/capistrano/karafka.rb +15 -5
- data/lib/capistrano/tasks/karafka.cap +23 -55
- data/lib/capistrano/tasks/karafka/restart.cap +9 -0
- data/lib/capistrano/tasks/karafka/start.cap +35 -0
- data/lib/capistrano/tasks/karafka/status.cap +28 -0
- data/lib/capistrano/tasks/karafka/stop.cap +35 -0
- metadata +15 -11
- data/lib/capistrano/karafka/version.rb +0 -8
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4c508336eb91f1a79204656633d7886e7d2c6581
|
4
|
+
data.tar.gz: 763280f3e84d79226238bc9b0a77a0bb9b96c26d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c07f9c784e1ca4baf4b22187dd79d334e1c22aee46a7d88b2800e93d0b24141592a11f603cd5036654bbf816f4d3cf0995573b902fef262291369ace35c8066d
|
7
|
+
data.tar.gz: 46c156740fae8bbe3561832e8d2a86cae2b616b104eebe02cb7ef6e94d9d6948f77f1ef1ccc3d71796f35b69734a34f55a3c58e42fab7af981b67d8eb54aab35
|
data/.gitignore
CHANGED
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,11 @@
|
|
1
1
|
# Capistrano Karafka changelog
|
2
2
|
|
3
|
+
## 1.1.0
|
4
|
+
- Support of Karafka 0.6+
|
5
|
+
- Support of multiple Karafka processes execution
|
6
|
+
- Support of multiple Karafka servers deployment
|
7
|
+
- Support for specifying customer groups, including multi-role customer groups execution
|
8
|
+
|
3
9
|
## 1.0.0
|
4
10
|
|
5
11
|
- Gem init
|
data/Gemfile.lock
ADDED
@@ -0,0 +1,133 @@
|
|
1
|
+
PATH
|
2
|
+
remote: .
|
3
|
+
specs:
|
4
|
+
capistrano-karafka (1.1.0)
|
5
|
+
capistrano (>= 3.9)
|
6
|
+
capistrano-bundler
|
7
|
+
karafka (>= 0.5)
|
8
|
+
|
9
|
+
GEM
|
10
|
+
remote: https://rubygems.org/
|
11
|
+
specs:
|
12
|
+
activesupport (5.1.3)
|
13
|
+
concurrent-ruby (~> 1.0, >= 1.0.2)
|
14
|
+
i18n (~> 0.7)
|
15
|
+
minitest (~> 5.1)
|
16
|
+
tzinfo (~> 1.1)
|
17
|
+
airbrussh (1.3.0)
|
18
|
+
sshkit (>= 1.6.1, != 1.7.0)
|
19
|
+
capistrano (3.9.0)
|
20
|
+
airbrussh (>= 1.0.0)
|
21
|
+
i18n
|
22
|
+
rake (>= 10.0.0)
|
23
|
+
sshkit (>= 1.9.0)
|
24
|
+
capistrano-bundler (1.2.0)
|
25
|
+
capistrano (~> 3.1)
|
26
|
+
sshkit (~> 1.2)
|
27
|
+
celluloid (0.17.3)
|
28
|
+
celluloid-essentials
|
29
|
+
celluloid-extras
|
30
|
+
celluloid-fsm
|
31
|
+
celluloid-pool
|
32
|
+
celluloid-supervision
|
33
|
+
timers (>= 4.1.1)
|
34
|
+
celluloid-essentials (0.20.5)
|
35
|
+
timers (>= 4.1.1)
|
36
|
+
celluloid-extras (0.20.5)
|
37
|
+
timers (>= 4.1.1)
|
38
|
+
celluloid-fsm (0.20.5)
|
39
|
+
timers (>= 4.1.1)
|
40
|
+
celluloid-pool (0.20.5)
|
41
|
+
timers (>= 4.1.1)
|
42
|
+
celluloid-supervision (0.20.6)
|
43
|
+
timers (>= 4.1.1)
|
44
|
+
concurrent-ruby (1.0.5)
|
45
|
+
connection_pool (2.2.1)
|
46
|
+
dry-configurable (0.7.0)
|
47
|
+
concurrent-ruby (~> 1.0)
|
48
|
+
dry-container (0.6.0)
|
49
|
+
concurrent-ruby (~> 1.0)
|
50
|
+
dry-configurable (~> 0.1, >= 0.1.3)
|
51
|
+
dry-core (0.3.1)
|
52
|
+
concurrent-ruby (~> 1.0)
|
53
|
+
dry-equalizer (0.2.0)
|
54
|
+
dry-logic (0.4.1)
|
55
|
+
dry-container (~> 0.2, >= 0.2.6)
|
56
|
+
dry-core (~> 0.2)
|
57
|
+
dry-equalizer (~> 0.2)
|
58
|
+
dry-types (0.11.1)
|
59
|
+
concurrent-ruby (~> 1.0)
|
60
|
+
dry-configurable (~> 0.1)
|
61
|
+
dry-container (~> 0.3)
|
62
|
+
dry-core (~> 0.2, >= 0.2.1)
|
63
|
+
dry-equalizer (~> 0.2)
|
64
|
+
dry-logic (~> 0.4, >= 0.4.0)
|
65
|
+
inflecto (~> 0.0.0, >= 0.0.2)
|
66
|
+
dry-validation (0.10.7)
|
67
|
+
concurrent-ruby (~> 1.0)
|
68
|
+
dry-configurable (~> 0.1, >= 0.1.3)
|
69
|
+
dry-core (~> 0.2, >= 0.2.1)
|
70
|
+
dry-equalizer (~> 0.2)
|
71
|
+
dry-logic (~> 0.4, >= 0.4.0)
|
72
|
+
dry-types (~> 0.9, >= 0.9.0)
|
73
|
+
envlogic (1.0.3)
|
74
|
+
activesupport
|
75
|
+
hitimes (1.2.6)
|
76
|
+
i18n (0.8.6)
|
77
|
+
inflecto (0.0.2)
|
78
|
+
karafka (0.5.0.3)
|
79
|
+
activesupport (~> 5.0)
|
80
|
+
celluloid (~> 0.17)
|
81
|
+
dry-configurable (~> 0.7)
|
82
|
+
dry-validation (~> 0.10.6)
|
83
|
+
envlogic (~> 1.0)
|
84
|
+
rake (~> 11.3)
|
85
|
+
ruby-kafka (= 0.3.17)
|
86
|
+
sidekiq (>= 4.2)
|
87
|
+
thor (~> 0.19)
|
88
|
+
waterdrop (~> 0.3.2.4)
|
89
|
+
worker-glass (~> 0.2)
|
90
|
+
minitest (5.10.3)
|
91
|
+
net-scp (1.2.1)
|
92
|
+
net-ssh (>= 2.6.5)
|
93
|
+
net-ssh (4.1.0)
|
94
|
+
null-logger (0.1.4)
|
95
|
+
rack (2.0.3)
|
96
|
+
rack-protection (2.0.0)
|
97
|
+
rack
|
98
|
+
rake (11.3.0)
|
99
|
+
redis (3.3.3)
|
100
|
+
ruby-kafka (0.3.17)
|
101
|
+
sidekiq (5.0.4)
|
102
|
+
concurrent-ruby (~> 1.0)
|
103
|
+
connection_pool (~> 2.2, >= 2.2.0)
|
104
|
+
rack-protection (>= 1.5.0)
|
105
|
+
redis (~> 3.3, >= 3.3.3)
|
106
|
+
sshkit (1.14.0)
|
107
|
+
net-scp (>= 1.1.2)
|
108
|
+
net-ssh (>= 2.8.0)
|
109
|
+
thor (0.20.0)
|
110
|
+
thread_safe (0.3.6)
|
111
|
+
timers (4.1.2)
|
112
|
+
hitimes
|
113
|
+
tzinfo (1.2.3)
|
114
|
+
thread_safe (~> 0.1)
|
115
|
+
waterdrop (0.3.2.4)
|
116
|
+
bundler
|
117
|
+
connection_pool
|
118
|
+
dry-configurable (~> 0.6)
|
119
|
+
null-logger
|
120
|
+
rake
|
121
|
+
ruby-kafka
|
122
|
+
worker-glass (0.2.4)
|
123
|
+
activesupport
|
124
|
+
null-logger
|
125
|
+
|
126
|
+
PLATFORMS
|
127
|
+
ruby
|
128
|
+
|
129
|
+
DEPENDENCIES
|
130
|
+
capistrano-karafka!
|
131
|
+
|
132
|
+
BUNDLED WITH
|
133
|
+
1.15.4
|
data/README.md
CHANGED
@@ -7,7 +7,7 @@ Karafka integration for Capistrano.
|
|
7
7
|
|
8
8
|
## Installation
|
9
9
|
|
10
|
-
Add this line to your application
|
10
|
+
Add this line to your application Gemfile:
|
11
11
|
|
12
12
|
```ruby
|
13
13
|
gem 'capistrano-karafka'
|
@@ -37,16 +37,63 @@ install_plugin Capistrano::Karafka
|
|
37
37
|
Take a look at the [set_defaults](https://github.com/karafka/capistrano-karafka/blob/master/lib/capistrano/karafka.rb#L16) method for options you can set. For example, to specify a different pidfile than default:
|
38
38
|
|
39
39
|
```ruby
|
40
|
-
set :karafka_pid, ->{ File.join(shared_path, 'tmp', 'pids', '
|
40
|
+
set :karafka_pid, ->{ File.join(shared_path, 'tmp', 'pids', 'karafka.pid') }
|
41
41
|
```
|
42
42
|
|
43
|
+
**Warning**: In order to make capistrano-karafka work with multiple processes, pidfile needs to end with ```.pid```.
|
44
|
+
|
45
|
+
## Multiple processes
|
46
|
+
|
47
|
+
You can configure Karafka to start with multiple processes. Just set the proper amount in ```karafka_processes```.
|
48
|
+
|
49
|
+
```ruby
|
50
|
+
set :karafka_processes, 4
|
51
|
+
```
|
52
|
+
|
53
|
+
## Different number of processes per host
|
54
|
+
|
55
|
+
You can configure how many processes you want to run on each host in the following way:
|
56
|
+
|
57
|
+
```ruby
|
58
|
+
set :karafka_role, %i[karafka_small karafka_big]
|
59
|
+
set :karafka_small_processes, 1
|
60
|
+
set :karafka_big_processes, 4
|
61
|
+
server 'example-small.com', roles: %i[karafka_small]
|
62
|
+
server 'example-big.com', roles: %i[karafka_big]
|
63
|
+
```
|
64
|
+
|
65
|
+
## Different active consumer groups per host and process
|
66
|
+
|
67
|
+
You can also easily start Karafka with a limited set of consumer groups running per each process for a given host:
|
68
|
+
|
69
|
+
```ruby
|
70
|
+
set :karafka_role, %i[karafka_small karafka_big]
|
71
|
+
|
72
|
+
set :karafka_small_processes, 1
|
73
|
+
set :karafka_small_consumer_groups, %w[
|
74
|
+
group_a
|
75
|
+
]
|
76
|
+
|
77
|
+
set :karafka_big_processes, 4
|
78
|
+
set :karafka_small_consumer_groups, [
|
79
|
+
'group_a group_b',
|
80
|
+
'group_c group_d',
|
81
|
+
'group_e',
|
82
|
+
'group_f'
|
83
|
+
]
|
84
|
+
|
85
|
+
server 'example-small.com', roles: %i[karafka_small]
|
86
|
+
server 'example-big.com', roles: %i[karafka_big]
|
87
|
+
```
|
88
|
+
|
89
|
+
By default, capistrano-karafka will start Karafka processes without limiting consumer groups, which means that each process will be running all of them.
|
90
|
+
|
43
91
|
## References
|
44
92
|
|
45
93
|
* [Karafka framework](https://github.com/karafka/karafka)
|
46
94
|
* [Capistrano Karafka](https://github.com/karafka/capistrano-karafka)
|
47
95
|
* [Waterdrop](https://github.com/karafka/waterdrop)
|
48
96
|
* [Envlogic](https://github.com/karafka/envlogic)
|
49
|
-
* [Worker Glass](https://github.com/karafka/worker-glass)
|
50
97
|
* [Null Logger](https://github.com/karafka/null-logger)
|
51
98
|
|
52
99
|
## Note on Patches/Pull Requests
|
@@ -56,6 +103,6 @@ Make your feature addition or bug fix.
|
|
56
103
|
Add tests for it. This is important so I don't break it in a future version unintentionally.
|
57
104
|
Commit, do not mess with Rakefile, version, or history. (if you want to have your own version, that is fine but bump version in a commit by itself I can ignore when I pull). Send me a pull request. Bonus points for topic branches.
|
58
105
|
|
59
|
-
[![coditsu](https://coditsu.io/assets/quality_bar.
|
106
|
+
[![coditsu](https://coditsu.io/assets/quality_bar.svg)](https://app.coditsu.io/coditsu/repositories/capistrano-karafka)
|
60
107
|
|
61
|
-
Each pull request must pass our quality requirements. To check if everything is as it should be, we use [Coditsu](https://coditsu.io) that combinse multiple linters and code analyzers.
|
108
|
+
Each pull request must pass our quality requirements. To check if everything is as it should be, we use [Coditsu](https://app.coditsu.io/coditsu/repositories/capistrano-karafka) that combinse multiple linters and code analyzers.
|
data/capistrano-karafka.gemspec
CHANGED
@@ -3,11 +3,9 @@
|
|
3
3
|
lib = File.expand_path('../lib', __FILE__)
|
4
4
|
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
5
5
|
|
6
|
-
require 'capistrano/karafka/version'
|
7
|
-
|
8
6
|
Gem::Specification.new do |spec|
|
9
7
|
spec.name = 'capistrano-karafka'
|
10
|
-
spec.version =
|
8
|
+
spec.version = '1.1.0'
|
11
9
|
spec.platform = Gem::Platform::RUBY
|
12
10
|
spec.authors = ['Maciej Mensfeld']
|
13
11
|
spec.email = %w[maciej@coditsu.io]
|
@@ -16,9 +14,9 @@ Gem::Specification.new do |spec|
|
|
16
14
|
spec.description = 'Karafka integration for Capistrano'
|
17
15
|
spec.license = 'MIT'
|
18
16
|
|
19
|
-
spec.add_dependency 'capistrano', '
|
17
|
+
spec.add_dependency 'capistrano', '>= 3.9'
|
20
18
|
spec.add_dependency 'capistrano-bundler'
|
21
|
-
spec.add_dependency 'karafka', '
|
19
|
+
spec.add_dependency 'karafka', '>= 0.5'
|
22
20
|
spec.required_ruby_version = '>= 2.3.0'
|
23
21
|
|
24
22
|
spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(spec)/}) }
|
data/lib/capistrano/karafka.rb
CHANGED
@@ -7,14 +7,20 @@ require 'capistrano/plugin'
|
|
7
7
|
module Capistrano
|
8
8
|
# Karafka Capistrano integration
|
9
9
|
class Karafka < Capistrano::Plugin
|
10
|
-
#
|
11
|
-
|
12
|
-
|
13
|
-
|
10
|
+
# Names of files that store capistrano procedures
|
11
|
+
CAP_FILES = %w[
|
12
|
+
karafka
|
13
|
+
karafka/start
|
14
|
+
karafka/stop
|
15
|
+
karafka/restart
|
16
|
+
karafka/status
|
17
|
+
].freeze
|
14
18
|
|
15
19
|
# Default values for Karafka settings
|
16
20
|
def set_defaults
|
17
|
-
set_if_empty :karafka_role, :
|
21
|
+
set_if_empty :karafka_role, :karafka
|
22
|
+
set_if_empty :karafka_processes, 1
|
23
|
+
set_if_empty :karafka_consumer_groups, []
|
18
24
|
set_if_empty :karafka_default_hooks, -> { true }
|
19
25
|
set_if_empty :karafka_env, -> { fetch(:karafka_env, fetch(:environment)) }
|
20
26
|
set_if_empty :karafka_pid, -> { File.join(shared_path, 'tmp', 'pids', 'karafka.pid') }
|
@@ -26,3 +32,7 @@ module Capistrano
|
|
26
32
|
end
|
27
33
|
end
|
28
34
|
end
|
35
|
+
|
36
|
+
Capistrano::Karafka::CAP_FILES.each do |cap_file|
|
37
|
+
eval File.open(File.expand_path("../tasks/#{cap_file}.cap", __FILE__), 'r').read
|
38
|
+
end
|
@@ -1,67 +1,35 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
# @note Inspired by Puma capistrano handlers
|
3
|
+
# @note Inspired by Puma capistrano handlers and Sidekiq capistrano handlers
|
4
4
|
# @see https://github.com/seuros/capistrano-puma/blob/master/lib/capistrano/tasks/puma.rake
|
5
|
+
# @see https://github.com/seuros/capistrano-sidekiq/blob/master/lib/capistrano/tasks/capistrano2.rb
|
5
6
|
namespace :karafka do
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
info 'Waiting for Karafka to stop'
|
23
|
-
sleep 5
|
24
|
-
end
|
25
|
-
end
|
26
|
-
end
|
27
|
-
end
|
28
|
-
|
29
|
-
desc 'Start Karafka'
|
30
|
-
task :start do
|
31
|
-
on roles(fetch(:karafka_role)) do |_host|
|
32
|
-
within current_path do
|
33
|
-
# We use all 3 because when combined with Sinatra/Rails it will use their parts as well
|
34
|
-
# so we want to set proper env for any of them
|
35
|
-
with(
|
36
|
-
KARAFKA_ENV: fetch(:karafka_env),
|
37
|
-
RAILS_ENV: fetch(:rails_env),
|
38
|
-
RACK_ENV: fetch(:rack_env)
|
39
|
-
) do
|
40
|
-
execute :bundle, "exec karafka server -d -p #{fetch(:karafka_pid)}"
|
41
|
-
end
|
7
|
+
# @return [Array<Hash>] hash with details about each of the processes that
|
8
|
+
# we're suppose to manage. Contains pidfile and consumer_groups for now
|
9
|
+
def processes_details
|
10
|
+
processes_details = []
|
11
|
+
|
12
|
+
Array(fetch(:karafka_role)).each do |role|
|
13
|
+
next unless host.roles.include?(role)
|
14
|
+
|
15
|
+
processes = fetch(:"#{role}_processes") || fetch(:karafka_processes)
|
16
|
+
consumer_groups = fetch(:"#{role}_consumer_groups") || fetch(:karafka_consumer_groups)
|
17
|
+
|
18
|
+
processes.times do |index|
|
19
|
+
processes_details << {
|
20
|
+
pidfile: fetch(:karafka_pid).gsub(/\.pid$/, "-#{index}.pid"),
|
21
|
+
consumer_groups: consumer_groups[index]
|
22
|
+
}
|
42
23
|
end
|
43
24
|
end
|
44
|
-
end
|
45
25
|
|
46
|
-
|
47
|
-
task :restart do
|
48
|
-
invoke 'karafka:stop'
|
49
|
-
invoke 'karafka:start'
|
26
|
+
processes_details
|
50
27
|
end
|
51
28
|
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
pid = capture "cat #{fetch(:karafka_pid)}"
|
57
|
-
|
58
|
-
if test "ps -p #{pid} > /dev/null"
|
59
|
-
info "Karafka is started: #{pid}"
|
60
|
-
else
|
61
|
-
error 'Karafka is not started but pidfile exists'
|
62
|
-
end
|
63
|
-
else
|
64
|
-
info 'Karafka is not started'
|
29
|
+
def for_each_process
|
30
|
+
processes_details.each_with_index do |process_details, index|
|
31
|
+
within release_path do
|
32
|
+
yield(process_details, index)
|
65
33
|
end
|
66
34
|
end
|
67
35
|
end
|
@@ -0,0 +1,35 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
namespace :karafka do
|
4
|
+
# Starts Karafka process with a given set of params
|
5
|
+
# @param [Hash] Details of a process that we're suppose to start
|
6
|
+
def start_karafka(process_details)
|
7
|
+
pidfile = process_details[:pidfile]
|
8
|
+
consumer_groups = process_details[:consumer_groups]
|
9
|
+
|
10
|
+
# We use all 3 because when combined with Sinatra/Rails it will use their parts as well
|
11
|
+
# so we want to set proper env for any of them
|
12
|
+
with(
|
13
|
+
KARAFKA_ENV: fetch(:karafka_env),
|
14
|
+
RAILS_ENV: fetch(:rails_env),
|
15
|
+
RACK_ENV: fetch(:rack_env)
|
16
|
+
) do
|
17
|
+
execute :bundle, [
|
18
|
+
'exec',
|
19
|
+
'karafka server',
|
20
|
+
'-d',
|
21
|
+
"-p #{pidfile}",
|
22
|
+
consumer_groups ? "-g #{consumer_groups}" : nil
|
23
|
+
].join(' ')
|
24
|
+
end
|
25
|
+
end
|
26
|
+
|
27
|
+
desc 'Start Karafka'
|
28
|
+
task :start do
|
29
|
+
on roles(fetch(:karafka_role)) do
|
30
|
+
for_each_process do |process_details|
|
31
|
+
start_karafka(process_details)
|
32
|
+
end
|
33
|
+
end
|
34
|
+
end
|
35
|
+
end
|
@@ -0,0 +1,28 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
namespace :karafka do
|
4
|
+
# Checks a status of a given Karafka process
|
5
|
+
# @param pidfile [String] path to a pidfile of a process that we want to check
|
6
|
+
def status_karafka(pidfile)
|
7
|
+
if test "cat #{pidfile}"
|
8
|
+
process_pid = capture "cat #{pidfile}"
|
9
|
+
|
10
|
+
if test "ps -p #{process_pid} > /dev/null"
|
11
|
+
info "Karafka #{process_pid} is started: #{pidfile}"
|
12
|
+
else
|
13
|
+
error "Karafka is not started but pidfile exists: #{pidfile}"
|
14
|
+
end
|
15
|
+
else
|
16
|
+
info "Karafka is not started: #{pidfile}"
|
17
|
+
end
|
18
|
+
end
|
19
|
+
|
20
|
+
desc 'Status Karafka'
|
21
|
+
task :status do
|
22
|
+
on roles fetch(:karafka_role) do
|
23
|
+
for_each_process do |process_details|
|
24
|
+
status_karafka(process_details[:pidfile])
|
25
|
+
end
|
26
|
+
end
|
27
|
+
end
|
28
|
+
end
|
@@ -0,0 +1,35 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
namespace :karafka do
|
4
|
+
# Stops a given Karafka process
|
5
|
+
# @param pidfile [String] path to a pidfile of a process that we're suppose to stop
|
6
|
+
def stop_karafka(pidfile)
|
7
|
+
# If there's no pidfile it means that Karafka is not running
|
8
|
+
unless test "cat #{pidfile}"
|
9
|
+
info "Karafka is not started: #{pidfile}"
|
10
|
+
return
|
11
|
+
end
|
12
|
+
|
13
|
+
# Send a kill signal to a given process
|
14
|
+
execute "kill -INT `cat #{pidfile}`"
|
15
|
+
|
16
|
+
# And wait until it finishes. We wait because we don't want to start next process until
|
17
|
+
# the previous one is stopped. That way we won't have problems with Kafka registering and
|
18
|
+
# deregistering processes from topics (although nothing bad would happen. It would just
|
19
|
+
# take more time to rebalance)
|
20
|
+
loop do
|
21
|
+
break unless test "cat #{pidfile}"
|
22
|
+
info 'Waiting for Karafka to stop'
|
23
|
+
sleep 5
|
24
|
+
end
|
25
|
+
end
|
26
|
+
|
27
|
+
desc 'Stop Karafka'
|
28
|
+
task :stop do
|
29
|
+
on roles(fetch(:karafka_role)) do
|
30
|
+
for_each_process do |process_details|
|
31
|
+
stop_karafka(process_details[:pidfile])
|
32
|
+
end
|
33
|
+
end
|
34
|
+
end
|
35
|
+
end
|
metadata
CHANGED
@@ -1,29 +1,29 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: capistrano-karafka
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Maciej Mensfeld
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-
|
11
|
+
date: 2017-08-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: capistrano
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- - "
|
17
|
+
- - ">="
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: '3.
|
19
|
+
version: '3.9'
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
|
-
- - "
|
24
|
+
- - ">="
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: '3.
|
26
|
+
version: '3.9'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: capistrano-bundler
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -42,16 +42,16 @@ dependencies:
|
|
42
42
|
name: karafka
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
|
-
- - "
|
45
|
+
- - ">="
|
46
46
|
- !ruby/object:Gem::Version
|
47
|
-
version: '0'
|
47
|
+
version: '0.5'
|
48
48
|
type: :runtime
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
|
-
- - "
|
52
|
+
- - ">="
|
53
53
|
- !ruby/object:Gem::Version
|
54
|
-
version: '0'
|
54
|
+
version: '0.5'
|
55
55
|
description: Karafka integration for Capistrano
|
56
56
|
email:
|
57
57
|
- maciej@coditsu.io
|
@@ -64,14 +64,18 @@ files:
|
|
64
64
|
- ".ruby-version"
|
65
65
|
- CHANGELOG.md
|
66
66
|
- Gemfile
|
67
|
+
- Gemfile.lock
|
67
68
|
- MIT-LICENCE
|
68
69
|
- README.md
|
69
70
|
- Rakefile
|
70
71
|
- capistrano-karafka.gemspec
|
71
72
|
- lib/capistrano-karafka.rb
|
72
73
|
- lib/capistrano/karafka.rb
|
73
|
-
- lib/capistrano/karafka/version.rb
|
74
74
|
- lib/capistrano/tasks/karafka.cap
|
75
|
+
- lib/capistrano/tasks/karafka/restart.cap
|
76
|
+
- lib/capistrano/tasks/karafka/start.cap
|
77
|
+
- lib/capistrano/tasks/karafka/status.cap
|
78
|
+
- lib/capistrano/tasks/karafka/stop.cap
|
75
79
|
homepage: https://github.com/karafka/capistrano-karafka
|
76
80
|
licenses:
|
77
81
|
- MIT
|