Class: Commands::DeployGroupDelete
- Inherits:
-
Object
- Object
- Commands::DeployGroupDelete
- Defined in:
- lib/commands/deploy_group_delete.rb
Instance Method Summary collapse
-
#options ⇒ Object
holds the options that were passed you can set any initial defaults here.
- #register(opts, global_options) ⇒ Object
-
#required_options ⇒ Object
required options.
- #run(global_options, amazon) ⇒ Object
Instance Method Details
#options ⇒ Object
holds the options that were passed you can set any initial defaults here
6 7 8 9 |
# File 'lib/commands/deploy_group_delete.rb', line 6 def ||= { } end |
#register(opts, global_options) ⇒ Object
18 19 20 21 22 23 24 25 26 |
# File 'lib/commands/deploy_group_delete.rb', line 18 def register(opts, ) opts. = "Usage: deploy_group_delete [options]" opts.description = "Delete a deploy group" opts.on('-g', "--group name", "Required - Name of this deploy group.") do |v| [:group] = v end end |
#required_options ⇒ Object
required options
12 13 14 15 16 |
# File 'lib/commands/deploy_group_delete.rb', line 12 def ||= Set.new [ :group, ] end |
#run(global_options, amazon) ⇒ Object
29 30 31 32 33 34 35 36 37 38 39 40 |
# File 'lib/commands/deploy_group_delete.rb', line 29 def run(, amazon) group_name = [:group] # first see if already exists deploy_group = amazon.find_deploy_group(group_name) if deploy_group.nil? || deploy_group[:group] != group_name raise "Deploy group not found. Doing nothing." end deploy_group.delete end |