Sha256: b1903fb08e53f58c27bea057d096b4c090e8b83997aad95124b0db3577cae1f4

Contents?: true

Size: 947 Bytes

Versions: 18

Compression:

Stored size: 947 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"

    option '--[no-]wait', :flag, 'Do not wait for service deployment', default: true

    requires_current_master
    requires_current_master_token

    def execute
      deployment = nil
      spinner "Triggering deployment of stack #{pastel.cyan(name)}" do
        deployment = deploy_stack(name)
      end
      if wait?
        spinner "Waiting for deployment to start" do
          wait_for_deployment_to_start(deployment)
        end
        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

18 entries across 18 versions & 1 rubygems

Version Path
kontena-cli-1.4.3 lib/kontena/cli/stacks/deploy_command.rb
kontena-cli-1.4.3.rc1 lib/kontena/cli/stacks/deploy_command.rb
kontena-cli-1.4.2 lib/kontena/cli/stacks/deploy_command.rb
kontena-cli-1.4.2.rc1 lib/kontena/cli/stacks/deploy_command.rb
kontena-cli-1.4.2.pre1 lib/kontena/cli/stacks/deploy_command.rb
kontena-cli-1.4.1 lib/kontena/cli/stacks/deploy_command.rb
kontena-cli-1.4.1.rc1 lib/kontena/cli/stacks/deploy_command.rb
kontena-cli-1.4.1.pre1 lib/kontena/cli/stacks/deploy_command.rb
kontena-cli-1.4.0 lib/kontena/cli/stacks/deploy_command.rb
kontena-cli-1.4.0.rc2 lib/kontena/cli/stacks/deploy_command.rb
kontena-cli-1.4.0.rc1 lib/kontena/cli/stacks/deploy_command.rb
kontena-cli-1.4.0.pre14 lib/kontena/cli/stacks/deploy_command.rb
kontena-cli-1.4.0.pre13 lib/kontena/cli/stacks/deploy_command.rb
kontena-cli-1.4.0.pre12 lib/kontena/cli/stacks/deploy_command.rb
kontena-cli-1.4.0.pre11 lib/kontena/cli/stacks/deploy_command.rb
kontena-cli-1.4.0.pre10 lib/kontena/cli/stacks/deploy_command.rb
kontena-cli-1.4.0.pre9 lib/kontena/cli/stacks/deploy_command.rb
kontena-cli-1.4.0.pre8 lib/kontena/cli/stacks/deploy_command.rb