Class: Commands::DeployGroupList

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

Instance Method Summary collapse

Instance Method Details

#optionsObject

holds the options that were passed you can set any initial defaults here



6
7
8
9
# File 'lib/commands/deploy_group_list.rb', line 6

def options
  @options ||= {
  }
end

#register(opts, global_options) ⇒ Object



17
18
19
20
21
# File 'lib/commands/deploy_group_list.rb', line 17

def register(opts, global_options)
  opts.banner = "Usage: deploy_group_list [options]"
  opts.description = "List the deploy groups"

end

#required_optionsObject

required options



12
13
14
15
# File 'lib/commands/deploy_group_list.rb', line 12

def required_options
  @required_options ||= Set.new [
  ]
end

#run(global_options, amazon) ⇒ Object



24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
# File 'lib/commands/deploy_group_list.rb', line 24

def run(global_options, amazon)
  ec2 = amazon.ec2

  # first see if already exists
  deploy_groups = ZZSharedLib::DeployGroupSimpleDB.find_all_by_zz_object_type(ZZSharedLib::DeployGroupSimpleDB.object_type, :auto_load => true)

  deploy_groups.each do |deploy_group|
    puts "Name: #{deploy_group[:group]}"
    puts "Recipes_deploy_tag: #{deploy_group[:recipes_deploy_tag]}"
    puts "App_deploy_tag: #{deploy_group[:app_deploy_tag]}"
    puts "Config Json:"
    pretty = JSON.pretty_generate(deploy_group.config)
    puts "#{pretty}"
    puts
  end
end