Class: Jamie::Driver::Vagrant
- Inherits:
-
SSHBase
- Object
- SSHBase
- Jamie::Driver::Vagrant
- Defined in:
- lib/jamie/driver/vagrant.rb
Overview
Vagrant driver for Jamie. It communicates to Vagrant via the CLI.
Instance Method Summary collapse
- #converge(state) ⇒ Object
- #create(state) ⇒ Object
- #destroy(state) ⇒ Object
- #login_command(state) ⇒ Object
Instance Method Details
#converge(state) ⇒ Object
45 46 47 |
# File 'lib/jamie/driver/vagrant.rb', line 45 def converge(state) run "vagrant provision #{state[:hostname]}" end |
#create(state) ⇒ Object
34 35 36 37 38 39 40 41 42 43 |
# File 'lib/jamie/driver/vagrant.rb', line 34 def create(state) # @todo Vagrantfile setup will be placed in any dependency hook # checks when feature is released vagrantfile = File.join(config[:jamie_root], "Vagrantfile") create_vagrantfile(vagrantfile) unless File.exists?(vagrantfile) state[:hostname] = instance.name run "vagrant up #{state[:hostname]} --no-provision" info("Vagrant instance <#{state[:hostname]}> created.") end |
#destroy(state) ⇒ Object
49 50 51 52 53 54 55 |
# File 'lib/jamie/driver/vagrant.rb', line 49 def destroy(state) return if state[:hostname].nil? run "vagrant destroy #{state[:hostname]} -f" info("Vagrant instance <#{state[:hostname]}> destroyed.") state.delete(:hostname) end |
#login_command(state) ⇒ Object
57 58 59 |
# File 'lib/jamie/driver/vagrant.rb', line 57 def login_command(state) %W{vagrant ssh #{state[:hostname]}} end |