Method: Ufo::Cfn::Stack#deploy

Defined in:
lib/ufo/cfn/stack.rb

#deployObject



29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
# File 'lib/ufo/cfn/stack.rb', line 29

def deploy
  build
  @stack = find_stack(@stack_name)
  if @stack && rollback_complete?(@stack)
    logger.info "Existing stack in ROLLBACK_COMPLETE state. Deleting stack before continuing."
    cloudformation.delete_stack(stack_name: @stack_name)
    status.wait
    status.reset
    @stack = nil # at this point stack has been deleted
  end

  exit_with_message(@stack) if @stack && !updatable?(@stack)

  @stack ? perform(:update) : perform(:create)

  stop_old_tasks if @options[:stop_old_task]

  return unless @options[:wait]
  status.wait

  logger.info status.rollback_error_message if status.update_rollback?

  status.success?
end