Sha256: f16623a643a21456d051d1c75454406533bcca6c2d4e19ad44b4d7bca9efe975

Contents?: true

Size: 666 Bytes

Versions: 11

Compression:

Stored size: 666 Bytes

Contents

module Kontena::Cli::ExternalRegistries
  class AddCommand < Clamp::Command
    include Kontena::Cli::Common

    def execute
      require 'highline/import'

      default_url = 'https://index.docker.io/v1/'
      require_api_url
      require_current_grid
      token = require_token

      username = ask("Username: ")
      password = ask("Password: ") { |q| q.echo = "*" }
      email = ask("Email: ")
      url = ask("URL [#{default_url}]: ")
      url = default_url if url.strip == ''
      data = { username: username, password: password, email: email, url: url }
      client(token).post("grids/#{current_grid}/external_registries", data)
    end
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
kontena-cli-0.10.0 lib/kontena/cli/external_registries/add_command.rb
kontena-cli-0.9.3 lib/kontena/cli/external_registries/add_command.rb
kontena-cli-0.9.2 lib/kontena/cli/external_registries/add_command.rb
kontena-cli-0.9.1 lib/kontena/cli/external_registries/add_command.rb
kontena-cli-0.9.0 lib/kontena/cli/external_registries/add_command.rb
kontena-cli-0.8.4 lib/kontena/cli/external_registries/add_command.rb
kontena-cli-0.8.3 lib/kontena/cli/external_registries/add_command.rb
kontena-cli-0.8.2 lib/kontena/cli/external_registries/add_command.rb
kontena-cli-0.8.1 lib/kontena/cli/external_registries/add_command.rb
kontena-cli-0.8.0.1 lib/kontena/cli/external_registries/add_command.rb
kontena-cli-0.8.0 lib/kontena/cli/external_registries/add_command.rb