Sha256: eef95aba928ed0f8dfed92d082076849ecca0aa4d087ed98d4f06c0f46739e2a

Contents?: true

Size: 1.1 KB

Versions: 34

Compression:

Stored size: 1.1 KB

Contents

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

    BANNER = Kontena.pastel.yellow("[DEPRECATED] This command is now deprecated in favor of 'kontena certificate request' command")

    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
      warn 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 pastel.green(secret)
      end
      puts "Use the #{secret}_BUNDLE with Kontena loadbalancer!"

    end
  end
end

Version data entries

34 entries across 34 versions & 2 rubygems

Version Path
krates-1.7.11 lib/kontena/cli/certificate/get_command.rb
krates-1.7.10 lib/kontena/cli/certificate/get_command.rb
krates-1.7.9 lib/kontena/cli/certificate/get_command.rb
krates-1.7.8 lib/kontena/cli/certificate/get_command.rb
krates-1.7.7 lib/kontena/cli/certificate/get_command.rb
krates-1.7.6 lib/kontena/cli/certificate/get_command.rb
krates-1.7.5 lib/kontena/cli/certificate/get_command.rb
krates-1.7.4 lib/kontena/cli/certificate/get_command.rb
krates-1.7.3 lib/kontena/cli/certificate/get_command.rb
krates-1.7.2 lib/kontena/cli/certificate/get_command.rb
krates-1.7.1 lib/kontena/cli/certificate/get_command.rb
krates-1.7.0 lib/kontena/cli/certificate/get_command.rb
krates-1.6.9 lib/kontena/cli/certificate/get_command.rb
krates-1.6.8 lib/kontena/cli/certificate/get_command.rb
krates-1.6.7 lib/kontena/cli/certificate/get_command.rb
krates-1.6.6 lib/kontena/cli/certificate/get_command.rb
krates-1.6.5 lib/kontena/cli/certificate/get_command.rb
krates-1.6.4 lib/kontena/cli/certificate/get_command.rb
krates-1.6.3 lib/kontena/cli/certificate/get_command.rb
krates-1.6.2 lib/kontena/cli/certificate/get_command.rb