Class: Kontena::Callbacks::SuggestInvitingYourself

Inherits:
Kontena::Callback show all
Defined in:
lib/kontena/callbacks/master/deploy/90_proptip_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
19
20
21
22
23
24
25
26
27
28
29
30
# File 'lib/kontena/callbacks/master/deploy/90_proptip_after_deploy.rb', line 7

def after
  extend Kontena::Cli::Common

  return unless current_master
  return unless command.exit_code == 0
  return if current_master.username.to_s == 'admin'

  puts
  puts Kontena.pastel.green("Protip:")

  if config.find_server("#{current_master.name}-admin")
    puts "  You are currently using the Kontena Master '#{Kontena.pastel.yellow(current_master.name)}' as"
    puts "  #{Kontena.pastel.yellow(current_master.username)}. To switch to the Kontena Master internal"
    puts "  administrator you can use:"
    puts "  #{Kontena.pastel.green.on_black("  kontena master use #{current_master.name}-admin  ")}"
    puts
  end
  puts "  To invite more users you can use:"
  puts "  #{Kontena.pastel.green.on_black("  kontena master user invite [email protected]  ")}"
  puts
  puts "  The users can then join the master by using the invite code: "
  puts "  #{Kontena.pastel.green.on_black("  kontena master join #{current_master.url} <invite_code>  ")}"
  puts
end