DEPRECATION NOTICE: This project has been deprecated as of 2018; please see Issue #27: Deprecate this project for details and further discussion.
This Vagrant configuration (with Ansible for provisioning) will install Jenkins, PHP, SonarQube, and Drupal CI profiles for code analysis (along with a bunch of other required software).
How is this helpful? It's easy to track things like code complexity, lines of code, comment percentage, coding standards compliance, and test coverage over time. Code quality helps make Drupal more maintainable, especially as the project continues to grow!
- Download and install VirtualBox.
- Download and install Vagrant.
- [Mac/Linux only] Install Ansible.
- Install Ansible roles:
ansible-galaxy install -r requirements.yml
(inside this directory).
Note for Windows users: This guide assumes you're on a Mac or Linux host. Windows support may be added when I get a little more time; the main difference is Ansible needs to be bootstrapped from within the VM after it's created. See JJG-Ansible-Windows for more information.
- Download this project and put it wherever you want.
- Open Terminal, cd to this directory (containing the
Vagrantfile
and this REAMDE file). - Type in
vagrant up
, and let Vagrant do its magic.
Note: If there are any errors during the course of running vagrant up
, and it drops you back to your command prompt, just run vagrant provision
to continue building the VM from where you left off. If there are still errors after doing this a few times, post an issue to this project's issue queue on GitHub with the error.
- Edit your hosts file, adding the line
192.168.99.9 drupalci.dev
so you can connect to the VMs. - Open your browser and access http://drupalci.dev/.
- If you're running this on a production server (visible to the Internet), make sure you configure Jenkins and Sonar security, and set secret/complex MySQL passwords for both the root and sonar users! (When setting up Jenkins security, be careful to not lock yourself out; if you do, you need to edit the Jenkins config.xml file and restart Jenkins).
- To shut down the virtual machine, enter
vagrant halt
in the Terminal in the same folder that has theVagrantfile
. To destroy it completely (if you want to save a little disk space, or want to rebuild it from scratch withvagrant up
again), type invagrant destroy
. - Find out more about local development with Vagrant + VirtualBox + Ansible in this presentation: Local Development Environments - Vagrant, VirtualBox and Ansible.
- Learn about how Ansible can accelerate your ability to innovate and manage your infrastructure by reading Ansible for DevOps.
This project was created in 2014 by Jeff Geerling, author of Ansible for DevOps.