vvv-init.sh
is ran when VVV sets up the site, and gives you an opportunity to execute shell commands, including WP CLI commands. This file is optional, but when combined with a git repository this becomes very powerful.
Your script might:
- Download and install the latest WordPress
- Update and install plugins
- Checkout extra git repos
- Run composer install
and other dependency managers and task runners
- Create an empty database if it doesn’t exist and fill it with starter content
Always Reprovision on Changes
Modifying a sites provisioner files, orconfig/config.yml
, requires a reprovision to take effect. To do this run: vagrant up --provision
You can find an example of a site provisioner here.
That script will:
- Check if a mysql database exists, if it doesn’t, create one and grant the needed priviledges
- Make sure the NGINX error logs are created
- Download, configure and install a fresh copy of WordPress or update the currently installed version of WordPress.
- Do other miscellaneous tasks like SSL certificate setup, setting locale, installing plugins, checking for multisite, etc