The following applications are required:
- Apache Ant (1.9+)
- Vagrant (1.4.3)
- Ruby (2.1+)
There are a few ways in which you should use these build scripts.
To use the Vagrant build scripts, add an <include>
to the top of the build file that requires Vagrant.
<include file="vagrant.xml" as="vagrant" />
<include file="ruby.xml" as="ruby" />
Change the following properties in your vagrant.properties
file. You can use ${vagrant.basedir}
, or your own configuration from build scripts.:
vagrant.vagrantfile
-- The (full or relative) path to your Vagrantfile.berks.berksfile
-- The (full of relative) path to your Berksfile
Change the following properties in your ruby.properties
file. You can use ${ruby.basedir}
, or your own configuration from build scripts.:
ruby.vagrantfile
-- The (full or relative) path to your Vagrantfile.
In order to make sure Vagrant, and some useful plugins (vagrant-omnibus, vagrant-berkshelf, and vagrant-vbguest), along with Berkshelf.
<target name="SomethingThatNeedsVagrant" depends="vagrant.install">
...
</target>
To install Vagrant's plugins, and Berkshelf, you can target vagrant.install
directly with ant vagrant.install
.
Using Apache Ant to control your Vagrant environment, and to make sure your recipies are up to date at the same time is easy.
Use ant vagrant.up
to bring up your Vagrant environment
ant vagrant.down
to shutdown your Vagrant down.
ant vagrant.destroy
will completely destroy your Vagrant environment
ant vagrant.install
will fail miserably in most cases on the vagrant-berkshelf
plugin install because of some strange permission issues with the gem requirements.
To overcome these issues, run ant vagrant.install
and wait for it to fail, then
issue sudo vagrant plugin install build/vagrant-berkshelf/pkg/vagrant-berkshelf-1.4.0.dev1.gem"
.
Normally, Apache Ant would be responsible for issuing all the commands, but because we adon't have a tty (as in, Ant doesn't give us one), we need to do it manually.
This relates to the issues located at hashicorp/vagrant#2402 and berkshelf/vagrant-berkshelf#89.
Once this issue is resolved, this can be included in the ant-vagrant/vagrant.xml.