Class: Kontena::Callbacks::CreateInitialGridAfterDeploy

Inherits:
Kontena::Callback show all
Defined in:
lib/kontena/callbacks/master/deploy/55_create_initial_grid_after_deploy.rb

Instance Attribute Summary

Attributes inherited from Kontena::Callback

#command

Instance Method Summary collapse

Methods inherited from Kontena::Callback

callbacks, #initialize, matches_commands, run_callbacks

Constructor Details

This class inherits a constructor from Kontena::Callback

Instance Method Details

#afterObject



7
8
9
10
11
12
13
14
15
16
17
18
# File 'lib/kontena/callbacks/master/deploy/55_create_initial_grid_after_deploy.rb', line 7

def after
  extend Kontena::Cli::Common

  return unless command.exit_code == 0
  return unless config.current_master
  return unless config.current_master.name == command.result[:name]

  cmd = %w(grid create --silent test)
  Retriable.retriable do
    Kontena.run!(cmd)
  end
end