Sha256: 116b6df5db9fffd345bd3faf8601d30e35f86df07224f919dbc17393dfcd91b0

Contents?: true

Size: 705 Bytes

Versions: 15

Compression:

Stored size: 705 Bytes

Contents

require_relative 'stacks_helper'

module Kontena::Cli::Stacks
  class DeployCommand < Kontena::Command
    include Kontena::Cli::Common
    include Kontena::Cli::GridOptions
    include StacksHelper

    banner "Deploys all services of a stack that has been installed in a grid on Kontena Master"

    parameter "NAME", "Stack name"

    requires_current_master
    requires_current_master_token

    def execute
      deployment = nil
      spinner "Deploying stack #{pastel.cyan(name)}" do
        deployment = deploy_stack(name)
        wait_for_deploy_to_finish(deployment)
      end
    end

    def deploy_stack(name)
      client.post("stacks/#{current_grid}/#{name}/deploy", {})
    end
  end
end

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
kontena-cli-1.1.0.pre1 lib/kontena/cli/stacks/deploy_command.rb
kontena-cli-1.0.6 lib/kontena/cli/stacks/deploy_command.rb
kontena-cli-1.0.6.rc1 lib/kontena/cli/stacks/deploy_command.rb
kontena-cli-1.0.5 lib/kontena/cli/stacks/deploy_command.rb
kontena-cli-1.0.5.rc1 lib/kontena/cli/stacks/deploy_command.rb
kontena-cli-1.0.5.pre1 lib/kontena/cli/stacks/deploy_command.rb
kontena-cli-1.0.4 lib/kontena/cli/stacks/deploy_command.rb
kontena-cli-1.0.4.rc2 lib/kontena/cli/stacks/deploy_command.rb
kontena-cli-1.0.4.rc1 lib/kontena/cli/stacks/deploy_command.rb
kontena-cli-1.0.3 lib/kontena/cli/stacks/deploy_command.rb
kontena-cli-1.0.3.rc1 lib/kontena/cli/stacks/deploy_command.rb
kontena-cli-1.0.2 lib/kontena/cli/stacks/deploy_command.rb
kontena-cli-1.0.2.rc2 lib/kontena/cli/stacks/deploy_command.rb
kontena-cli-1.0.2.rc1 lib/kontena/cli/stacks/deploy_command.rb
kontena-cli-1.0.2.pre1 lib/kontena/cli/stacks/deploy_command.rb