Sha256: 8fd49c16a4680f27ca969ca2de592c09e14c5e520f223e90a5783d422fa3ceca

Contents?: true

Size: 1.08 KB

Versions: 17

Compression:

Stored size: 1.08 KB

Contents

module Kontena::Cli::Certificate
  class GetCommand < Kontena::Command
    include Kontena::Cli::Common
    include Kontena::Cli::GridOptions

    BANNER = "This command is now deprecated in favor of 'kontena certificate request' command".colorize(:red)

    banner BANNER

    option '--secret-name', 'SECRET_NAME', 'The name for the secret to store the certificate in'
    option '--cert-type', 'CERT_TYPE', 'The type of certificate to get: fullchain, chain or cert', default: 'fullchain'
    parameter "DOMAIN ...", "Domain(s) to get certificate for"


    def execute
      puts BANNER

      require_api_url
      token = require_token
      secret = secret_name || "LE_CERTIFICATE_#{domain_list[0].gsub('.', '_')}"
      data = {domains: domain_list, secret_name: secret}

      response = client(token).post("certificates/#{current_grid}/certificate", data)
      puts "Certificate successfully received and stored into vault with keys:"
      response.each do |secret|
        puts secret.colorize(:green)
      end
      puts "Use the #{secret}_BUNDLE with Kontena loadbalancer!"

    end
  end
end

Version data entries

17 entries across 17 versions & 1 rubygems

Version Path
kontena-cli-1.4.2 lib/kontena/cli/certificate/get_command.rb
kontena-cli-1.4.2.rc1 lib/kontena/cli/certificate/get_command.rb
kontena-cli-1.4.2.pre1 lib/kontena/cli/certificate/get_command.rb
kontena-cli-1.4.1 lib/kontena/cli/certificate/get_command.rb
kontena-cli-1.4.1.rc1 lib/kontena/cli/certificate/get_command.rb
kontena-cli-1.4.1.pre1 lib/kontena/cli/certificate/get_command.rb
kontena-cli-1.4.0 lib/kontena/cli/certificate/get_command.rb
kontena-cli-1.4.0.rc2 lib/kontena/cli/certificate/get_command.rb
kontena-cli-1.4.0.rc1 lib/kontena/cli/certificate/get_command.rb
kontena-cli-1.4.0.pre14 lib/kontena/cli/certificate/get_command.rb
kontena-cli-1.4.0.pre13 lib/kontena/cli/certificate/get_command.rb
kontena-cli-1.4.0.pre12 lib/kontena/cli/certificate/get_command.rb
kontena-cli-1.4.0.pre11 lib/kontena/cli/certificate/get_command.rb
kontena-cli-1.4.0.pre10 lib/kontena/cli/certificate/get_command.rb
kontena-cli-1.4.0.pre9 lib/kontena/cli/certificate/get_command.rb
kontena-cli-1.4.0.pre8 lib/kontena/cli/certificate/get_command.rb
kontena-cli-1.4.0.pre7 lib/kontena/cli/certificate/get_command.rb