Sha256: d8b05a8ff1019a27cc83880617e7b8f0ea639311742a9f756b31b1d73b1f3d4b
Contents?: true
Size: 975 Bytes
Versions: 29
Compression:
Stored size: 975 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" parameter "NAME ...", "Stack name", attribute_name: :names option '--[no-]wait', :flag, 'Wait for deployment to finish', default: true requires_current_master requires_current_master_token def execute names.each do |name| 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 end def deploy_stack(name) client.post("stacks/#{current_grid}/#{name}/deploy", {}) end end end
Version data entries
29 entries across 29 versions & 2 rubygems