Class: Lono::Sets::Waiter

Inherits:
Object
  • Object
show all
Includes:
Summarize
Defined in:
lib/lono/sets/waiter.rb

Instance Method Summary collapse

Methods included from Summarize

#summarize

Methods included from AwsServices

#cfn, #ec2, #iam, #s3, #s3_presigner, #s3_resource, #sts

Methods included from AwsServices::Helper

#rollback_complete?, #testing_update?

Methods included from AwsServices::StackSet

#find_stack_set, #stack_set_exists?

Methods included from AwsServices::Stack

#find_stack, #stack_exists?

Constructor Details

#initialize(options) ⇒ Waiter

Returns a new instance of Waiter.



5
6
7
8
9
# File 'lib/lono/sets/waiter.rb', line 5

def initialize(options)
  @options = options
  @stack = options[:stack]
  @wait = @options[:wait].nil? ? true : @options[:wait]
end

Instance Method Details

#run(operation_id) ⇒ Object



11
12
13
14
15
16
17
18
19
20
21
# File 'lib/lono/sets/waiter.rb', line 11

def run(operation_id)
  message = "Deploying #{@stack} stack set"
  puts message unless @options[:mute]
  return unless @wait

  status = Status.new(@options.merge(operation_id: operation_id))
  success = status.wait
  summarize(operation_id)
  exit 1 unless success
  success
end