VCCW

Vagrant based development environment for WordPress plugins, themes, or websites.

View project onGitHub

VCCW v3 is now available!
If you want to use VCCW v2, Please visit v2.vccw.cc.

Development environment for WordPress

This is a Vagrant configuration designed for development of WordPress plugins, themes, or websites.

VCCW includes customizable variables for setting the WordPress version (or beta release), language, hostname, subdirectory, admin credentials, default plugins, default theme, multisite, SSL and other options. These variables give you a lot of flexibility in tailoring your development environment to your specific needs.

What's Installed

Requires

  • Vagrant 1.8.6 or later
  • VirtualBox 5.1.6 or later

Back to top

Getting Started

1. Install VirtualBox.

https://www.virtualbox.org/

2. Install Vagrant.

http://www.vagrantup.com/

3. Install the vagrant-hostsupdater plugin. (Optional)

$ vagrant plugin install vagrant-hostsupdater

Important!!

Windows does not allow to change hosts files. Please add vccw.dev 192.168.33.10 by yourself!

4. Download vagrant box

$ vagrant box add vccw-team/xenial64

5. Please download .zip or .tar.gz.

Download.zip

6. Change into a new directory.

$ cd vccw-x.x.x

7. Start a Vagrant environment.

$ vagrant up

8. Visit WordPress on the Vagrant in your browser

Visit http://vccw.dev/ or http://192.168.33.10/

Back to top

Environments

WordPress

This tool installs a WordPress environment with these settings by default.

  • Default user
    • Username: admin
    • Password: admin

MySQL

  • MySQL Host: 127.0.0.1
  • Username: wordpress or root
  • Password: wordpress
  • Port: 3306

SSH

  • Host: vccw.dev or 192.168.33.10
  • Username: vagrant
  • Password: vagrant
  • Port: 22

You can login virtual machine with vagrant ssh.

Back to top

Customizing

VCCW is configured for those developing WordPress plugins, themes or websites. It includes many customizable variables for setting the WordPress version (or beta release), language, hostname, subdirectory, admin credentials, default plugins, default theme, multisite, SSL and other options. These variables give you a lot of flexibility in tailoring your development environment to your specific needs.

Copy provision/default.yml to site.yml like following.

$ cp provision/default.yml site.yml

Then edit the site.yml and run vagrant up.

Or place the site.yml and put variables like following.

hostname: example.com
ip: 192.168.33.11
lang: ja
plugins:
  - contact-form-7
  - jetpack
theme: twentysixteen

Then just run vagrant up.

Global configuration

VCCW has a series of global parameters which work with all virtual machines.

They can be specified ~/.vccw/config.yml like following.

memory: 1024
cpus: 2
lang: ja
theme_unit_test: true

Customizable variables

See provision/default.yml.

Back to top

Run pre/post provisioning scripts

You can place shell scripts, so it will run at pre/post provisioning.

  • provision-pre.sh - Run before chef provisioning.
  • provision-post.sh - Run after chef provisioning.

Example shell script.

provision-post.sh - It will run after provisioning.

#!/usr/bin/env bash

set -ex

/usr/local/bin/wp --path=/var/www/wordpress plugin install contact-form-7 --activate

This example script will install and activate plugin "Contact Form 7" by WP-CLI.

Customize with Ansible

Also, you can use Ansible.

provision-post.yml - It will run after provisioning.

- hosts: all
  become: yes

  tasks:

  - name: Ensure nginx is installed
    apt: pkg=nginx state=latest

Back to top

Checking Email with MailCatcher

MailCathcer re-routes all WordPress emails to Mailcatcher.

Please visit: http://vccw.dev:1080/

WP-CLI

We developed a community command that generates a VCCW environment.

https://github.com/vccw-team/scaffold-vccw

How to install

$ wp package install vccw/scaffold-vccw:@stable

How to use

Generate a VCCW environment into the wp.dev directory.

$ wp scaffold vccw wp.dev
Generating:   100% [===========================] 0:03 / 0:06
Success: Generated.
$ cd wp.dev
$ vagrant up

Usage

$ wp help scaffold vccw
NAME

  wp scaffold vccw

DESCRIPTION

  Generate a new VCCW environment.

SYNOPSIS

  wp scaffold vccw <directory> [--host=<hostname>] [--ip=<ip-address>]
  [--lang=<language>]

OPTIONS

  <directory>
    The directory of the new VCCW based guest machine.

  [--host=<hostname>]
    Hostname of the guest machine. Default is `vccw.dev`.

  [--ip=<ip-address>]
    IP address of the guest machine. Default is `192.168.33.10`.

  [--lang=<language>]
    Language of the WordPress. Default is `en_US`.

EXAMPLES

    $ wp scaffold vccw wordpress.dev
    Generating:   100% [===========================] 0:03 / 0:06
    Success: Generated.

    $ wp scaffold vccw wordpress.dev --lang=ja
    Generating:   100% [===========================] 0:03 / 0:06
    Success: Generated.

Changelog

https://github.com/vccw-team/vccw/releases

Back to top