Class: DockerRailsProxy::Stack::Destroy

Inherits:
DockerRailsProxy::Stack show all
Defined in:
lib/docker_rails_proxy/commands/stack/destroy.rb

Constant Summary

Constants inherited from DockerRailsProxy::Stack

RUNNING_STATUSES

Constants included from Callbacks

Callbacks::INHERITABLE_CALLBACKS, Callbacks::UNINHERITABLE_CALLBACKS

Instance Attribute Summary collapse

Attributes inherited from DockerRailsProxy::Stack

#options

Attributes inherited from Base

#additional_arguments, #additional_arguments_options, #arguments

Instance Method Summary collapse

Methods inherited from Base

build_path, call, command, execute, #initialize

Methods included from Logger

included, #logger

Methods included from Rsync

included, #sync

Methods included from Callbacks

included

Methods included from InheritableAttributes

included

Constructor Details

This class inherits a constructor from DockerRailsProxy::Base

Instance Attribute Details

#stacksObject

Returns the value of attribute stacks.



4
5
6
# File 'lib/docker_rails_proxy/commands/stack/destroy.rb', line 4

def stacks
  @stacks
end

Instance Method Details

#processObject



29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
# File 'lib/docker_rails_proxy/commands/stack/destroy.rb', line 29

def process
  begin
    print_options(stacks, 'Choose the stack number and press [ENTER]')
    stack_name = get_option(stacks)
  end while stack_name.blank?

  puts "You're about to destroy this stack: #{stack_name}, are you sure? [yes]:"
  exit unless $stdin.gets.chomp == 'yes'

  puts "Destroying #{stack_name} stack"

  system <<-EOS
    aws cloudformation delete-stack \
      --stack-name '#{stack_name}' \
      --profile '#{options[:profile]}'
  EOS
end