VIP Go Site Boilerplate
A modern setup for WordPress VIP Go hosted projects:
🏭Uses Composer for adding project dependencies, including plugins and themes. 🌎Uses Composer autoloader for using any of the popular PHP packages anywhere in the codebase. 👩💻Provides a local development environment based on Docker that can be run inside Vagrant without having to install Docker on the host machine. 🚀Includes automated build and deploy pipelines to WordPress VIP Go.
Principles and Ideas
Upstream Repositories for Deployment Only
Deployment process always starts from the same clean state which enables reproducable builds accross different environments such as local development machines and continuous integration services. See the "Deployments" section below for more details.
We suggest using Homebrew for installing all project dependencies.
- Project plugins and themes can be added as Composer dependencies or manualy to this repository under
- Composer dependencies are placed under
- Composer autoloader
public/plugins/vendor/autoload.phpis included in
- Composer installers maps WordPress plugins, themes and mu-plugins to sub-directories under
Create a fresh Git repository from this reference repository:
composer create-project xwp/vip-go-site --stability dev
Add your theme and plugins as Composer dependencies:
composer require your/theme your/plugin another/plugin
or by manually copying them from existing repositories to
public/plugins. Remember to start tracking those directories by excluding them in
Local Development Environment
If using Docker inside Vagrant, adjust the hostname of the development environment in
Vagrantfileto match your project.
- config.vm.hostname = "vipgo" + config.vm.hostname = "your-project"
which will create the development environment at
Start the development environment using Vagrant:
or using Docker Compose:
Deployments to the VIP Go upstream repository are handled by
scripts/deploy.sh which does a clean checkout of the deploy branch to
deploy/src, runs the build pipeline and copies the the
public directory with the resulting artifects to
rsync) which contains the upstream VIP Go repository. It then creates a new branch with the new changes and pushes it to the upstream repository.
- Change the repository URL for
package.jsonto match your VIP Go upstream repository.
- Adjust the build sequence in
scripts/deploy.shto match your setup.
npm run deploy-stagingto deploy to the
npm run deploy-productionto deploy to the
masterbranch of the upstream VIP Go repository.
- Visit GitHub to open a pull request to the deploy target branch.
All suggestions and contributions are welcome!