Sha256: 26d0168fbff0b3dab905f3a014f5752ffaed8f3dd799d904c3efaba8372cadbd

Contents?: true

Size: 592 Bytes

Versions: 14

Compression:

Stored size: 592 Bytes

Contents

require_relative 'common'

module Kontena::Cli::Stacks
  class CreateCommand < 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)

      create_stack
    end

    private

    def create_stack
      client(token).post("stacks/#{current_grid}", @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/create_command.rb
kontena-cli-0.15.5.rc2 lib/kontena/cli/stacks/create_command.rb
kontena-cli-0.15.5.rc1 lib/kontena/cli/stacks/create_command.rb
kontena-cli-0.15.4 lib/kontena/cli/stacks/create_command.rb
kontena-cli-0.15.4.rc2 lib/kontena/cli/stacks/create_command.rb
kontena-cli-0.15.4.rc1 lib/kontena/cli/stacks/create_command.rb
kontena-cli-0.15.4.pre1 lib/kontena/cli/stacks/create_command.rb
kontena-cli-0.15.3 lib/kontena/cli/stacks/create_command.rb
kontena-cli-0.15.2 lib/kontena/cli/stacks/create_command.rb
kontena-cli-0.15.1 lib/kontena/cli/stacks/create_command.rb
kontena-cli-0.15.0 lib/kontena/cli/stacks/create_command.rb
kontena-cli-0.15.0.rc3 lib/kontena/cli/stacks/create_command.rb
kontena-cli-0.15.0.rc2 lib/kontena/cli/stacks/create_command.rb
kontena-cli-0.15.0.rc1 lib/kontena/cli/stacks/create_command.rb