Class: Beaker::Subcommand
- Inherits:
-
Thor
- Object
- Thor
- Beaker::Subcommand
- Defined in:
- lib/beaker/subcommand.rb
Constant Summary collapse
- SubcommandUtil =
Beaker::Subcommands::SubcommandUtil
Instance Method Summary collapse
- #init(hypervisor = 'vagrant') ⇒ Object
-
#initialize(*args) ⇒ Subcommand
constructor
A new instance of Subcommand.
- #provision ⇒ Object
Constructor Details
#initialize(*args) ⇒ Subcommand
Returns a new instance of Subcommand.
9 10 11 12 |
# File 'lib/beaker/subcommand.rb', line 9 def initialize(*args) super @@config = SubcommandUtil.init_config() end |
Instance Method Details
#init(hypervisor = 'vagrant') ⇒ Object
61 62 63 64 65 66 67 68 69 70 71 72 |
# File 'lib/beaker/subcommand.rb', line 61 def init(hypervisor='vagrant') if [:help] invoke :help, [], ["init"] return end SubcommandUtil.verify_init_args(hypervisor) SubcommandUtil.require_tasks() SubcommandUtil.init_hypervisor(hypervisor) say "Writing host config to .beaker/acceptance/config/default_#{hypervisor}_hosts.yaml" SubcommandUtil.store_config({:hypervisor => hypervisor}) SubcommandUtil.delete_config([:provisioned]) end |
#provision ⇒ Object
81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 |
# File 'lib/beaker/subcommand.rb', line 81 def provision() if [:help] invoke :help, [], ["provision"] return end hypervisor = @@config.transaction { @@config[:hypervisor] } unless hypervisor SubcommandUtil.error_with("Please initialise a configuration") end provisioned = @@config.transaction { @@config[:provisioned] } if !provisioned or [:force] SubcommandUtil.provision(hypervisor, ) SubcommandUtil.store_config({:provisioned => true}) else say "Hosts have already been provisioned" end end |