Sha256: 8010b4edf37ddc0a0a8f0a1c152f2dfee0ab46a44a3ab870e3eeab80afdea8a0

Contents?: true

Size: 828 Bytes

Versions: 53

Compression:

Stored size: 828 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 "Triggering deployment of stack #{pastel.cyan(name)}" do
        deployment = deploy_stack(name)
      end
      spinner "Waiting for deployment to start" do
        wait_for_deployment_to_start(deployment)
      end
      wait_for_deploy_to_finish(deployment)
    end

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

Version data entries

53 entries across 53 versions & 1 rubygems

Version Path
kontena-cli-1.3.5 lib/kontena/cli/stacks/deploy_command.rb
kontena-cli-1.3.5.rc1 lib/kontena/cli/stacks/deploy_command.rb
kontena-cli-1.4.0.pre6 lib/kontena/cli/stacks/deploy_command.rb
kontena-cli-1.4.0.pre5 lib/kontena/cli/stacks/deploy_command.rb
kontena-cli-1.4.0.pre4 lib/kontena/cli/stacks/deploy_command.rb
kontena-cli-1.4.0.pre3 lib/kontena/cli/stacks/deploy_command.rb
kontena-cli-1.4.0.pre2 lib/kontena/cli/stacks/deploy_command.rb
kontena-cli-1.4.0.pre1 lib/kontena/cli/stacks/deploy_command.rb
kontena-cli-1.3.4 lib/kontena/cli/stacks/deploy_command.rb
kontena-cli-1.3.4.rc1 lib/kontena/cli/stacks/deploy_command.rb
kontena-cli-1.3.3 lib/kontena/cli/stacks/deploy_command.rb
kontena-cli-1.3.3.rc1 lib/kontena/cli/stacks/deploy_command.rb
kontena-cli-1.3.2 lib/kontena/cli/stacks/deploy_command.rb
kontena-cli-1.3.2.rc2 lib/kontena/cli/stacks/deploy_command.rb
kontena-cli-1.3.2.rc1 lib/kontena/cli/stacks/deploy_command.rb
kontena-cli-1.3.1 lib/kontena/cli/stacks/deploy_command.rb
kontena-cli-1.3.1.rc2 lib/kontena/cli/stacks/deploy_command.rb
kontena-cli-1.3.1.rc1 lib/kontena/cli/stacks/deploy_command.rb
kontena-cli-1.3.0 lib/kontena/cli/stacks/deploy_command.rb
kontena-cli-1.3.0.rc4 lib/kontena/cli/stacks/deploy_command.rb