Class: Catfish::CLI::Provision
- Inherits:
-
Object
- Object
- Catfish::CLI::Provision
- Defined in:
- lib/catfish/cli/provision.rb
Instance Attribute Summary collapse
-
#options ⇒ Object
readonly
Returns the value of attribute options.
Instance Method Summary collapse
-
#initialize(options) ⇒ Provision
constructor
A new instance of Provision.
- #run ⇒ Object
Constructor Details
#initialize(options) ⇒ Provision
Returns a new instance of Provision.
5 6 7 |
# File 'lib/catfish/cli/provision.rb', line 5 def initialize() @options = end |
Instance Attribute Details
#options ⇒ Object (readonly)
Returns the value of attribute options.
3 4 5 |
# File 'lib/catfish/cli/provision.rb', line 3 def @options end |
Instance Method Details
#run ⇒ Object
9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 |
# File 'lib/catfish/cli/provision.rb', line 9 def run puts 'Provisioning to servers using Catfishfile.lock' vagrant_version begin # Connect to the servers. The --provider=managed is the key here. system("vagrant up /managed/ --provider=#{[:provider]}") # Confirm the connectivity status = `vagrant status /managed/ --machine-readable` if status.include? 'not reachable' abort 'ERROR DEPLOYING: One or more servers could not be connected to' end provision status ensure # Disconnect from all of the servers system 'vagrant destroy -f /managed/' end end |