Sha256: a065cf83a5b702775f310a71adf76424333f3d905d1012eb3a937e5398e765ff

Contents?: true

Size: 1.06 KB

Versions: 12

Compression:

Stored size: 1.06 KB

Contents

require_relative '../common'

module Kontena::Cli::Stacks::Registry
  class ShowCommand < Kontena::Command
    include Kontena::Cli::Common
    include Kontena::Cli::Stacks::Common
    include Kontena::Cli::Stacks::Common::StackNameParam

    banner "Shows information about a stack on the stacks registry"

    option ['-v', '--versions'], :flag, "Only list available versions"

    requires_current_account_token

    def execute
      require 'semantic'
      unless versions?
        stack = ::YAML.load(stacks_client.show(stack_name, stack_version))
        puts "#{stack['stack']}:"
        puts "  #{"latest_" unless stack_version}version: #{stack['version']}"
        puts "  expose: #{stack['expose'] || '-'}"
        puts "  description: #{stack['description'] || '-'}"

        puts "  available_versions:"
      end

      stacks_client.versions(stack_name).reject {|s| s['version'].nil? || s['version'].empty?}.map { |s| Semantic::Version.new(s['version'])}.sort.reverse_each do |version|
        puts versions? ? version : "    - #{version}"
      end
    end
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
kontena-cli-1.0.2 lib/kontena/cli/stacks/registry/show_command.rb
kontena-cli-1.0.2.rc2 lib/kontena/cli/stacks/registry/show_command.rb
kontena-cli-1.0.2.rc1 lib/kontena/cli/stacks/registry/show_command.rb
kontena-cli-1.0.2.pre1 lib/kontena/cli/stacks/registry/show_command.rb
kontena-cli-1.0.1 lib/kontena/cli/stacks/registry/show_command.rb
kontena-cli-1.0.1.rc3 lib/kontena/cli/stacks/registry/show_command.rb
kontena-cli-1.0.1.rc2 lib/kontena/cli/stacks/registry/show_command.rb
kontena-cli-1.0.1.rc1 lib/kontena/cli/stacks/registry/show_command.rb
kontena-cli-1.0.0 lib/kontena/cli/stacks/registry/show_command.rb
kontena-cli-1.0.0.rc2 lib/kontena/cli/stacks/registry/show_command.rb
kontena-cli-1.0.0.rc1 lib/kontena/cli/stacks/registry/show_command.rb
kontena-cli-1.0.0.pre4 lib/kontena/cli/stacks/registry/show_command.rb