Sha256: 07cf70409f5df6529a30882ccabd8c076ddad214d50d8658cc5b42e2a63eaa7a

Contents?: true

Size: 732 Bytes

Versions: 2

Compression:

Stored size: 732 Bytes

Contents

require_relative '../common'

module Kontena::Cli::Stacks::Registry
  class PushCommand < Kontena::Command
    include Kontena::Cli::Common
    include Kontena::Cli::Stacks::Common

    banner "Pushes (uploads) a stack to the stack registry"

    parameter "FILENAME", "Stack file path"

    requires_current_account_token

    def execute
      file = Kontena::Cli::Stacks::YAML::Reader.new(
        filename,
        skip_variables: true,
        skip_validation: true
      )
      file.execute
      name = "#{file.stack_name}:#{file.stack_version}"
      spinner("Pushing #{pastel.cyan(name)} to stacks registry") do
        stacks_client.push(file.stack_name, file.stack_version, file.raw_content)
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
kontena-cli-1.1.0.rc2 lib/kontena/cli/stacks/registry/push_command.rb
kontena-cli-1.1.0.rc1 lib/kontena/cli/stacks/registry/push_command.rb