Sha256: 554510fac1f6ada78a5a0a4c8690dc32f683f6286234d2dc0fa5cecbd5b125fa

Contents?: true

Size: 907 Bytes

Versions: 14

Compression:

Stored size: 907 Bytes

Contents

class Ufo::CLI
  class Destroy < Base
    def run
      are_you_sure?

      stack = find_stack(@stack_name)
      unless stack
        puts "Stack #{@stack_name.color(:green)} does not exist."
        exit 1
      end

      if stack.stack_status =~ /_IN_PROGRESS$/
        puts "Cannot destroy service #{@service.color(:green)}"
        puts "Cannot delete stack #{@stack_name.color(:green)} in this state: #{stack.stack_status.color(:green)}"
        puts "If the stack is taking a long time, you can cancel the current operation with:"
        puts "    ufo cancel #{@service}"
        return
      end

      cloudformation.delete_stack(stack_name: @stack_name)
      puts "Deleting stack #{@stack_name.color(:green)}"

      return unless @options[:wait]
      status.wait
    end

    def are_you_sure?
      sure?("You are about to destroy the #{@stack_name.color(:green)} stack")
    end
  end
end

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
ufo-6.1.5 lib/ufo/cli/destroy.rb
ufo-6.1.4 lib/ufo/cli/destroy.rb
ufo-6.1.3 lib/ufo/cli/destroy.rb
ufo-6.1.2 lib/ufo/cli/destroy.rb
ufo-6.1.1 lib/ufo/cli/destroy.rb
ufo-6.1.0 lib/ufo/cli/destroy.rb
ufo-6.0.9 lib/ufo/cli/destroy.rb
ufo-6.0.8 lib/ufo/cli/destroy.rb
ufo-6.0.7 lib/ufo/cli/destroy.rb
ufo-6.0.6 lib/ufo/cli/destroy.rb
ufo-6.0.5 lib/ufo/cli/destroy.rb
ufo-6.0.4 lib/ufo/cli/destroy.rb
ufo-6.0.3 lib/ufo/cli/destroy.rb
ufo-6.0.2 lib/ufo/cli/destroy.rb