Sha256: f03b5141751b31b87fdc237d483a61a0719404d7db37cab5b8f56bd6d8b1002c

Contents?: true

Size: 594 Bytes

Versions: 21

Compression:

Stored size: 594 Bytes

Contents

require_relative 'common'

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

21 entries across 21 versions & 1 rubygems

Version Path
kontena-cli-0.16.3 lib/kontena/cli/stacks/create_command.rb
kontena-cli-0.16.3.rc1 lib/kontena/cli/stacks/create_command.rb
kontena-cli-0.16.2 lib/kontena/cli/stacks/create_command.rb
kontena-cli-0.16.2.rc1 lib/kontena/cli/stacks/create_command.rb
kontena-cli-0.16.1 lib/kontena/cli/stacks/create_command.rb
kontena-cli-0.16.1.rc3 lib/kontena/cli/stacks/create_command.rb
kontena-cli-0.16.1.rc2 lib/kontena/cli/stacks/create_command.rb
kontena-cli-0.16.1.rc1 lib/kontena/cli/stacks/create_command.rb
kontena-cli-0.16.0 lib/kontena/cli/stacks/create_command.rb
kontena-cli-0.16.0.rc3 lib/kontena/cli/stacks/create_command.rb
kontena-cli-0.16.0.rc2 lib/kontena/cli/stacks/create_command.rb
kontena-cli-0.16.0.rc1 lib/kontena/cli/stacks/create_command.rb
kontena-cli-0.16.0.pre9 lib/kontena/cli/stacks/create_command.rb
kontena-cli-0.16.0.pre8 lib/kontena/cli/stacks/create_command.rb
kontena-cli-0.16.0.pre7 lib/kontena/cli/stacks/create_command.rb
kontena-cli-0.16.0.pre6 lib/kontena/cli/stacks/create_command.rb
kontena-cli-0.16.0.pre5 lib/kontena/cli/stacks/create_command.rb
kontena-cli-0.16.0.pre4 lib/kontena/cli/stacks/create_command.rb
kontena-cli-0.16.0.pre3 lib/kontena/cli/stacks/create_command.rb
kontena-cli-0.16.0.pre2 lib/kontena/cli/stacks/create_command.rb