Class: Capistrano::Karafka

Inherits:
Plugin
  • Object
show all
Defined in:
lib/capistrano/karafka.rb

Overview

Karafka Capistrano integration

Constant Summary collapse

CAP_FILES =

Names of files that store capistrano procedures

%w[
  karafka
  karafka/start
  karafka/stop
  karafka/restart
  karafka/status
].freeze

Instance Method Summary collapse

Instance Method Details

#register_hooksObject

Deploy hooks registration



30
31
32
# File 'lib/capistrano/karafka.rb', line 30

def register_hooks
  after 'deploy:finished', 'karafka:restart'
end

#set_defaultsObject

Default values for Karafka settings



20
21
22
23
24
25
26
27
# File 'lib/capistrano/karafka.rb', line 20

def set_defaults
  set_if_empty :karafka_role, :karafka
  set_if_empty :karafka_processes, 1
  set_if_empty :karafka_consumer_groups, []
  set_if_empty :karafka_default_hooks, -> { true }
  set_if_empty :karafka_env, -> { fetch(:karafka_env, fetch(:environment)) }
  set_if_empty :karafka_pid, -> { File.join(shared_path, 'tmp', 'pids', 'karafka.pid') }
end