This Phing extension provides a wrapper for the Vagrant binary, so that Vagrant virtual machines can be easily controlled from within Phing build targets. While this task library is not designed to be 100% feature complete with the Vagrant command line, it should provide what is required during Phing builds.
Software | Version |
---|---|
PHP | 7.1+ |
Vagrant | TBD* |
- I have been submitting patches to Vagrant's machine-readable mode, to get all of the Phing tasks here working correctly. As a result, the minimum version for this extension will likely be 2.2.5 or higher, but this remains to be seen.
Name | Example Value | Set By | Description |
---|---|---|---|
vagrant.path |
/usr/bin/vagrant |
You | Tells the Phing tasks where to find the Vagrant executable. (Can also be specified per-task using an attribute.) |
vagrant.version |
2.2.5 |
vagrant-status | The version of Vagrant that Phing is executing tasks against |
vagrant.plugin-list |
vagrant-vbguest,vagrant-reload |
vagrant-status | Comma separated list of installed Vagrant plugins |
vagrant.plugin-version.{pluginName} |
1.8.0 |
vagrant-status | The version of the named plugin that is currently installed |
vagrant.plugin-scope.{pluginName} |
global or local |
vagrant-status | Whether the named plugin was installed globally for all projects on the system, or locally to the current project |
phing-vagrant's codebase requires no prep to develop against other than installing its Composer dependencies, along with Vagrant and a supported Vagrant provider.
git clone https://github.com/GregJPreece/phing-vagrant
cd phing-vagrant
composer install
As so many combinations of operating system, Vagrant package and provider package exist, installation of Vagrant and its VM provider are left as an exercise for the reader. Virtualbox is a common FOSS provider easily obtainable on most platforms, and as such is the default provider for Vagrant.
Being popular FOSS projects, both Vagrant and Virtualbox are likely to be available via your operating system's package manager, if it has one.
phing-vagrant uses Codeception (which in turn uses PHPUnit) to provide automated testing. Note that running these tests does not require Vagrant or a provider to be installed. To run tests, ensure you have installed the project's Composer dependencies, and then:
vendor/bin/codecept run
Vagrant's --machine-readable
flag is not currently a complete effort, and is
marked as such in their documentation. However, rather than attempting to parse
fragile output intended for a UI, I am instead documenting these issues and
submitting patches to Vagrant where within my abilities as a non-Ruby coder. Details
of what I have found so far and their current status can be found
at this link.