Sha256: 5248e34a2159f784b868ea28b26aa6ec368719e3fc75d2167fc5fabd4a8001a5

Contents?: true

Size: 1.23 KB

Versions: 77

Compression:

Stored size: 1.23 KB

Contents

module Kontena
  module Callbacks
    class SuggestInvitingYourself < Kontena::Callback

      matches_commands 'master create'

      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_address@example.com  ")}"
        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
    end
  end
end

Version data entries

77 entries across 77 versions & 2 rubygems

Version Path
krates-1.7.11 lib/kontena/callbacks/master/deploy/90_proptip_after_deploy.rb
krates-1.7.10 lib/kontena/callbacks/master/deploy/90_proptip_after_deploy.rb
krates-1.7.9 lib/kontena/callbacks/master/deploy/90_proptip_after_deploy.rb
krates-1.7.8 lib/kontena/callbacks/master/deploy/90_proptip_after_deploy.rb
krates-1.7.7 lib/kontena/callbacks/master/deploy/90_proptip_after_deploy.rb
krates-1.7.6 lib/kontena/callbacks/master/deploy/90_proptip_after_deploy.rb
krates-1.7.5 lib/kontena/callbacks/master/deploy/90_proptip_after_deploy.rb
krates-1.7.4 lib/kontena/callbacks/master/deploy/90_proptip_after_deploy.rb
krates-1.7.3 lib/kontena/callbacks/master/deploy/90_proptip_after_deploy.rb
krates-1.7.2 lib/kontena/callbacks/master/deploy/90_proptip_after_deploy.rb
krates-1.7.1 lib/kontena/callbacks/master/deploy/90_proptip_after_deploy.rb
krates-1.7.0 lib/kontena/callbacks/master/deploy/90_proptip_after_deploy.rb
krates-1.6.9 lib/kontena/callbacks/master/deploy/90_proptip_after_deploy.rb
krates-1.6.8 lib/kontena/callbacks/master/deploy/90_proptip_after_deploy.rb
krates-1.6.7 lib/kontena/callbacks/master/deploy/90_proptip_after_deploy.rb
krates-1.6.6 lib/kontena/callbacks/master/deploy/90_proptip_after_deploy.rb
krates-1.6.5 lib/kontena/callbacks/master/deploy/90_proptip_after_deploy.rb
krates-1.6.4 lib/kontena/callbacks/master/deploy/90_proptip_after_deploy.rb
krates-1.6.3 lib/kontena/callbacks/master/deploy/90_proptip_after_deploy.rb
krates-1.6.2 lib/kontena/callbacks/master/deploy/90_proptip_after_deploy.rb