Class: Cody::Stack

Inherits:
Object
  • Object
show all
Includes:
AwsServices, Status
Defined in:
lib/cody/stack.rb,
lib/cody/stack/base.rb,
lib/cody/stack/create.rb,
lib/cody/stack/status.rb,
lib/cody/stack/update.rb

Defined Under Namespace

Modules: Status Classes: Base, Create, Update

Instance Method Summary collapse

Methods included from Status

#status

Methods included from AwsServices

#cfn, #codebuild

Methods included from AwsServices::Helpers

#are_you_sure?, #find_stack, #inferred_project_name, #inferred_stack_name, #normalize_stack_name, #project_name_convention, #stack_exists?

Constructor Details

#initialize(options) ⇒ Stack

Returns a new instance of Stack.



8
9
10
11
12
# File 'lib/cody/stack.rb', line 8

def initialize(options)
  @options = options
  @project_name = @options[:project_name] || inferred_project_name
  @stack_name = normalize_stack_name(options[:stack_name] || inferred_stack_name(@project_name))
end

Instance Method Details

#runObject



14
15
16
17
18
19
20
21
# File 'lib/cody/stack.rb', line 14

def run
  handle_rollback_completed!
  if stack_exists?(@stack_name)
    Update.new(@options).run
  else
    Create.new(@options).run
  end
end