Sha256: 22c00ec601d47a6d3e4b1cfd19c4448c2f2b76c6986995079c4827a189a47526

Contents?: true

Size: 702 Bytes

Versions: 3

Compression:

Stored size: 702 Bytes

Contents

module Kontena::Cli::Master
  class JoinCommand < Kontena::Command
    parameter "URL", "Kontena Master URL or name"
    parameter "INVITE_CODE", "Invitation code"

    option ['-n', '--name'], '[NAME]', 'Set server name'
    option ['-r', '--remote'], :flag, 'Do not try to open a browser'
    option ['-v', '--verbose'], :flag, 'Increase output verbosity'

    def execute
      params = []
      params << "--join #{self.invite_code.shellescape}"
      params << "--remote" if self.remote?
      params << "--name #{self.name.shellescape}" if self.name
      params << "--verbose" if self.verbose?

      cmd = ['master', 'login'] + params
      cmd << url
      Kontena.run!(cmd)
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
kontena-cli-1.3.0.rc1 lib/kontena/cli/master/join_command.rb
kontena-cli-1.3.0.pre2 lib/kontena/cli/master/join_command.rb
kontena-cli-1.3.0.pre1 lib/kontena/cli/master/join_command.rb