README.md

Graft VM

Getting Started

What is Graft?

Graft is the official virtual machine for Theme Juice,
a powerful way to develop WordPress sites locally on your machine. Theme Juice is
a cross-platform desktop application built on top of our open source command line
utility, tj, that enables you to create,
manage and deploy local WordPress development projects at the click of a button.

Graft VM is a high-quality LAMP development environment, configured specifically
for WordPress development, that comes pre-packaged and pre-provisioned, so that
you can get up and running as quickly as possible.

What is Vagrant?

Vagrant is a "tool for building and distributing development
environments". It works with virtualization
software such as VirtualBox to provide a virtual machine
that is sandboxed away from your local environment. It can be shutdown, destroyed
and recreated at anytime, so feel free to break things!

Dependencies

Before you run vagrant up, please ensure you have the following software installed:

Dashboard

You can view things such as a PHP phpinfo() dump, phpMemcachedAdmin, phpMyAdmin,
Webgrind and more through the main dashboard:

http://graft.dev

Customization

You may customize your PHP, MySql and Apache configurations by modifying their
corresponding 'overrides' file within config/. The changes will be synced to
the virtual machine on the next vagrant provision.

You may disable Mailcatcher and/or Xdebug from within the Vagrantfile via the
Chef provisioning block. When changed, you will need to reprovision the VM
by running vagrant provision.

There are an array of options given within the Vagrantfile such as PHP, Ruby,
MySQL and Node versions, but none of these are guaranteed to work if modified
from their current state. Those options are provided as-is and are not officially
supported when changed; they are simply used for provisioning the box.

Credentials

MySQL

Hostname: localhost

Username: root

Password: root

SSH

Hostname: 192.168.13.37

Username: vagrant

Password: vagrant

Xdebug

Within config/php-config/overrides.ini, you'll see a section devoted to Xdebug.
By default, it will be commented out. If you'd like to use it, simply activate
Xdebug within your Vagrantfile (shown above), and uncomment the Xdebug settings
within the overrides.ini file.

If you're not going to use it, I'd recommend that you disable Xdebug, as well
disable the xdebug.profiler-related settings:

xdebug.profiler_enable = 0

Doing so should dramatically increase your virtual machine's performance. Be sure
to run vagrant provision to put any changes/modifications you make into effect.

Mailcatcher

Ensure that Mailcatcher is enabled within your Vagrantfile, then visit:

http://graft.dev:1080

Automatic database backup

By default, if the vagrant-triggers plugin is installed, a script will run
on halt and suspend that backs up each database to a project.sql file within
the /database/backup/ directory. These will then be imported automatically on
each vagrant up, even if your VM has recently been destroy'd.

This is done so that you have the freedom to run vagrant destroy without
losing all that precious data stored within your databases. Just remember that
the database is not backed up on destroy, so be sure to run vagrant halt
before a destroy if you want to back everything up.

Automatically generated self-signed SSL certs

When a .conf file within config/apache-config/sites/ contains a virtual host with
a *:443 port number, a self-signed SSL certificate will automatically be generated
on the next provision. For example, a virtual host that looks like this,

that way we can be sure that we run the provisioners on a fresh box before
building a new Atlas release. After provisioning the new release, SSH into the
virtual machine and run the following commands to clean up:

Notes

We're using Berkshelf to vendor our cookbooks. You can
see our configuration within the Berksfile. Before shipping a new build for
the Vagrant box and uploading to Atlas, be sure to run berks vendor, so that
the end-user can does not need to have Berkshelf or the ChefDK installed on
their machine. Vagrant will use the cookbooks inside of the berks-cookbooks
directory automatically when provisioning with Chef Solo.