Sha256: 8e4ee82861d33d117349f865f80af3bc5ffc1c5747a3024959972d2e69d61794

Contents?: true

Size: 836 Bytes

Versions: 4

Compression:

Stored size: 836 Bytes

Contents

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


    option '--secret-name', 'SECRET_NAME', 'The name for the secret to store the certificate in'
    parameter "DOMAIN ...", "Domain(s) to get certificate for"


    def execute
      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

4 entries across 4 versions & 1 rubygems

Version Path
kontena-cli-0.15.0 lib/kontena/cli/certificate/get_command.rb
kontena-cli-0.15.0.rc3 lib/kontena/cli/certificate/get_command.rb
kontena-cli-0.15.0.rc2 lib/kontena/cli/certificate/get_command.rb
kontena-cli-0.15.0.rc1 lib/kontena/cli/certificate/get_command.rb