Sha256: 734abdcd9581041dd3f6067e5a9fa5b65fc2f482832a7b6d3cc2459a111439fd

Contents?: true

Size: 916 Bytes

Versions: 16

Compression:

Stored size: 916 Bytes

Contents

require_relative 'common'

module Kontena::Cli::Stacks
  class InstallCommand < Kontena::Command
    include Kontena::Cli::Common
    include Kontena::Cli::GridOptions
    include Common

    banner "Installs a stack to a grid on Kontena Master"

    include Common::StackFileOrNameParam

    include Common::StackNameOption
    option '--[no-]deploy', :flag, 'Trigger deploy after installation', default: true

    include Common::StackValuesFromOption


    requires_current_master
    requires_current_master_token

    def execute
      stack = stack_from_yaml(filename, name: name, values: values)

      stack['name'] = name if name
      spinner "Creating stack #{pastel.cyan(stack['name'])} " do
        create_stack(stack)
      end
      Kontena.run("stack deploy #{stack['name']}") if deploy?
    end

    def create_stack(stack)
      client.post("grids/#{current_grid}/stacks", stack)
    end
  end
end

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
kontena-cli-1.1.6 lib/kontena/cli/stacks/install_command.rb
kontena-cli-1.2.0.pre1 lib/kontena/cli/stacks/install_command.rb
kontena-cli-1.1.5 lib/kontena/cli/stacks/install_command.rb
kontena-cli-1.1.5.rc3 lib/kontena/cli/stacks/install_command.rb
kontena-cli-1.1.5.rc2 lib/kontena/cli/stacks/install_command.rb
kontena-cli-1.1.5.rc1 lib/kontena/cli/stacks/install_command.rb
kontena-cli-1.1.4 lib/kontena/cli/stacks/install_command.rb
kontena-cli-1.2.0.dev1 lib/kontena/cli/stacks/install_command.rb
kontena-cli-1.1.3 lib/kontena/cli/stacks/install_command.rb
kontena-cli-1.1.2 lib/kontena/cli/stacks/install_command.rb
kontena-cli-1.1.2.rc2 lib/kontena/cli/stacks/install_command.rb
kontena-cli-1.1.2.rc1 lib/kontena/cli/stacks/install_command.rb
kontena-cli-1.1.1 lib/kontena/cli/stacks/install_command.rb
kontena-cli-1.1.1.rc1 lib/kontena/cli/stacks/install_command.rb
kontena-cli-1.1.0 lib/kontena/cli/stacks/install_command.rb
kontena-cli-1.1.0.rc2 lib/kontena/cli/stacks/install_command.rb