Class: Opsicle::ChefUpdate

Inherits:
Object
  • Object
show all
Defined in:
lib/opsicle/commands/chef_update.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(environment) ⇒ ChefUpdate

Returns a new instance of ChefUpdate.



11
12
13
14
15
16
# File 'lib/opsicle/commands/chef_update.rb', line 11

def initialize(environment)
  @environment = environment
  @client = Client.new(environment)
  @stack = Stack.new(@client)
  @tar_file = "#{@stack.name}.tgz"
end

Instance Attribute Details

#clientObject (readonly)

Returns the value of attribute client.



7
8
9
# File 'lib/opsicle/commands/chef_update.rb', line 7

def client
  @client
end

#stackObject (readonly)

Returns the value of attribute stack.



9
10
11
# File 'lib/opsicle/commands/chef_update.rb', line 9

def stack
  @stack
end

#tar_fileObject (readonly)

Returns the value of attribute tar_file.



8
9
10
# File 'lib/opsicle/commands/chef_update.rb', line 8

def tar_file
  @tar_file
end

Instance Method Details

#execute(options = { monitor: true }) ⇒ Object



18
19
20
21
22
23
24
# File 'lib/opsicle/commands/chef_update.rb', line 18

def execute(options={ monitor: true })
  tar_cookbooks(options[:path])
  s3_upload(options[:"bucket-name"])
  cleanup_tar
  update_custom_cookbooks
  launch_stack_monitor(options)
end