Sha256: d82bbf8a2a7f616ace53e3a4c4e171937062bc34b2f72fda0e6f6b3e688fafa1

Contents?: true

Size: 609 Bytes

Versions: 14

Compression:

Stored size: 609 Bytes

Contents

require_relative 'common'

module Kontena::Cli::Stacks
  class UpdateCommand < Clamp::Command
    include Kontena::Cli::Common
    include Kontena::Cli::GridOptions
    include Common

    option ['-f', '--file'], 'FILE', 'Specify an alternate Kontena stack file', attribute_name: :filename, default: 'kontena.yml'

    def execute
      require_api_url
      require_token
      require_config_file(filename)
      @stack = stack_from_yaml(filename)

      update_stack
    end

    private

    def update_stack
      client(token).put("stacks/#{current_grid}/#{@stack['name']}", @stack)
    end

  end
end

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
kontena-cli-0.15.5 lib/kontena/cli/stacks/update_command.rb
kontena-cli-0.15.5.rc2 lib/kontena/cli/stacks/update_command.rb
kontena-cli-0.15.5.rc1 lib/kontena/cli/stacks/update_command.rb
kontena-cli-0.15.4 lib/kontena/cli/stacks/update_command.rb
kontena-cli-0.15.4.rc2 lib/kontena/cli/stacks/update_command.rb
kontena-cli-0.15.4.rc1 lib/kontena/cli/stacks/update_command.rb
kontena-cli-0.15.4.pre1 lib/kontena/cli/stacks/update_command.rb
kontena-cli-0.15.3 lib/kontena/cli/stacks/update_command.rb
kontena-cli-0.15.2 lib/kontena/cli/stacks/update_command.rb
kontena-cli-0.15.1 lib/kontena/cli/stacks/update_command.rb
kontena-cli-0.15.0 lib/kontena/cli/stacks/update_command.rb
kontena-cli-0.15.0.rc3 lib/kontena/cli/stacks/update_command.rb
kontena-cli-0.15.0.rc2 lib/kontena/cli/stacks/update_command.rb
kontena-cli-0.15.0.rc1 lib/kontena/cli/stacks/update_command.rb