Class: Opsicle::ChefUpdate

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from DeployHelper

#launch_stack_monitor, #open_deploy

Constructor Details

#initialize(environment) ⇒ ChefUpdate

Returns a new instance of ChefUpdate.



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

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.



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

def client
  @client
end

#stackObject (readonly)

Returns the value of attribute stack.



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

def stack
  @stack
end

#tar_fileObject (readonly)

Returns the value of attribute tar_file.



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

def tar_file
  @tar_file
end

Instance Method Details

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



20
21
22
23
24
25
26
27
28
# File 'lib/opsicle/commands/chef_update.rb', line 20

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