This software is derived from Varying Vagrant Vagrants. It is an open source Vagrant configuration focused on CiviCRM development. Cividev inherits VVV's MIT License.
The primary goal of civicrm-buildkit-vagrant (cividev) is to provide a complete and easily installable development environment for CiviCRM with a standard server setup and CiviCRM configuration templates.
Cividev is ideal for testing new releases, developing extensions and contributing to CiviCRM core.
Cividev requires recent versions of both Vagrant (1.7+) and VirtualBox (4.3+) to be installed. If you use it for development, it will work with your favorite locally installed development environment.
Vagrant is a "tool for building and distributing development environments". It works with virtualization software such as VirtualBox to provide a virtual machine sandboxed from your local environment.
Once Vagrant and VirtualBox are installed, download or clone cividev and type vagrant up
to automatically build a virtualized Ubuntu server on your computer containing everything needed to test or develop with any combination of CMS and CiviCRM versions. See our section on The First Vagrant Up for detailed instructions.
Multiple projects can be developed at once in the same environment. Cividev is pre-configured with the following CiviCRM configurations:
Cividev's config
, database
, log
and www
directories are shared with the virtualized server.
These shared directories allow you to work, for example, in cividev/www/d7-master
in your local file system and have those changes immediately reflected in the virtualized server's file system and http://d7-master.test/. Likewise, if you vagrant ssh
and make modifications to the files in /srv/www/
, you'll immediately see those changes in your local file system.
vagrant
will now be available as a command in your terminal, try it out.vagrant -v
to check the version. You may want to consider upgrading if an older version is in use.vagrant plugin install vagrant-hostsupdater
hosts
file to access the provisioned VVV (Varying Vagrant Vagrants) domains in your browser.hosts
file:
192.168.123.10 cividev civi.test d7-master.test wp-master.test d7-46.test wp-46.test
192.168.123.10 d8-46.test b-46.test d8-master.test b-master.test
vagrant plugin install vagrant-triggers
vagrant halt
and vagrant destroy
.db_backup
script will run on halt, suspend, and destroy that backs up each database to a dbname.sql
file in the {vvv}/database/backups/
directory. These will then be imported automatically if starting from scratch. Custom scripts can be added to override this default behavior.git clone git://github.com/civicrm/civicrm-buildkit-vagrant.git cividev
cividev
directory on your computer.cd
from the command prompt to do this.vagrant up
su
password may be required to properly modify the hosts file on your local machine.Fancy, yeah?
The first time you run vagrant up
, a packaged box containing a basic virtual machine is downloaded to your local machine and cached for future use. The file used by Varying Vagrant Vagrants contains an installation of Ubuntu 14.04 and is about 332MB.
After this box is downloaded, it begins to boot as a sandboxed virtual machine using VirtualBox. Once booted, it runs the provisioning script included with VVV. This initiates the download and installation of around 100MB of packages on the new virtual machine. Then buildkit is downloaded, configured and the d7-master configuration is built (therefore pre-seeding all caches).
The time for all of this to happen depends a lot on the speed of your Internet connection. If you are on a fast cable connection, it will likely take around 30 minutes.
On future runs of vagrant up
, the packaged box will be cached on your local machine and Vagrant will only need to apply the requested provisioning.
vagrant halt
, vagrant up
will quickly power on the machine without provisioning.vagrant up --provision
or vagrant provision
, some time will be taken to check for updates and packages that have not been installed.vagrant destroy
, it will need to download the full 100MB of package data on the next vagrant up
.Now that you're up and running, start poking around and modifying things.
vagrant ssh
from your vagrant-local
directory. You can do almost anything you would do with a standard Ubuntu installation on a full server.
vagrant halt
and turn it back on with vagrant up
.vagrant suspend
and bring it right back with vagrant resume
.vagrant provision
.vagrant destroy
. Files added in the www
directory will persist on the next vagrant up
.The network configuration picks an IP of 192.168.123.10. It could cause conflicts on your existing network if you are on a 192.168.123.x subnet already. You can configure any IP address in the Vagrantfile
and it will be used on the next vagrant up
Cividev relies on the stability of both Vagrant and Virtualbox. These caveats are common to Vagrant environments and are worth noting:
vagrant destroy
is used before moving, this should be fine.The default memory allotment for the cividev virtual machine is 1024MB. If you would like to raise or lower this value to better match your system requirements, a guide to changing memory size is in the wiki.
All CMS usernames and passwords for these installations are demo / demo
and admin / admin
by default.
The MySQL/phpMyAdmin username and password is root / root
by default.
Please note that cividev is a development and testing environment, it is NOT secure and NOT intended to be used in production or on any Internet-accessible server.
CD to /srv/www/d7-master/sites/all/modules/civicrm/tools/scripts Run phpunit /srv/www/d7-master/sites/all/modules/civicrm/tests/phpunit/HelloTest.php
A bunch of stuff!
Cividev is derivative work based on VVV. VVV is copyright (c) 2014-2015, the contributors of the VVV project under the MIT License.