Class: Moonshot::Commands::Update

Inherits:
Moonshot::Command show all
Includes:
ParameterArguments, ParentStackOption, ShowAllEventsOption, TagArguments
Defined in:
lib/moonshot/commands/update.rb

Instance Method Summary collapse

Methods inherited from Moonshot::Command

inherited

Instance Method Details

#executeObject



34
35
36
37
# File 'lib/moonshot/commands/update.rb', line 34

def execute
  @force = true unless Moonshot.config.interactive
  controller.update(dry_run: @dry_run, force: @force, refresh_parameters: @refresh_parameters)
end

#parserObject



14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
# File 'lib/moonshot/commands/update.rb', line 14

def parser
  parser = super

  parser.on('--dry-run', TrueClass, 'Show the changes that would be applied, but do not execute them') do |v|
    @dry_run = v
  end

  parser.on('--force', '-f', TrueClass, 'Apply ChangeSet without confirmation') do |v|
    @force = v
  end

  parser.on('--refresh-parameters', TrueClass, 'Update parameters from parent stacks') do |v|
    @refresh_parameters = v
  end

  parser.on('--template-file=FILE', 'Override the path to the CloudFormation template.') do |v|
    Moonshot.config.template_file = v
  end
end