This is the development repo for mu-plugins on VIP Go,
You can find selective PHPDoc documentation here: https://automattic.github.io/vip-go-mu-plugins/
These are generated via CI by the generate-docs.sh
script.
make lint
We have a script that runs unit tests in a self-contained Docker environment.
usage: ./bin/phpunit-docker.sh [wp-version]
You can either pass a version number to test against a specific version, or leave it blank to test against the latest version.
-
Set up VVV and your vagrant environment
-
Navigate to your
wp-content
folder and clone this repo intomu-plugins
:
$ git clone https://github.com/Automattic/vip-go-mu-plugins.git mu-plugins
- SSH into your box and navigate to the
mu-plugins
folder:
$ vagrant ssh
vagrant@vvv:~$cd /path/to/wp-content/mu-plugins
- Setup the WordPress tests:
vagrant@vvv:
vagrant@vvv:/wp-content/mu-plugins$ ./bin/install-wp-tests.sh %empty_DB_name% %db_user% %db_name%
Note: you need to replace the %placeholder%
strings above with the appropriate values. Use a separate test database for this as the contents will get trashed during testing.
- Install dependencies
Note: need to have composer pre-installed.
composer install
- Run tests:
vagrant@vvv:/wp-content/mu-plugins$ vendor/bin/phpunit
PHP Linting and PHPUnit tests are also run by Travis as part of PRs and merges. See the script
section of .travis.yml
.
For Automattic Use: Instructions are in the FG :)
This is a repo primarily meant for local non-development use. It e
Every commit merged into master
is automatically pushed to the public copy at Automattic/vip-go-mu-plugins-built. This is handled via CI by the deploy.sh
script script, which builds pushes a copy of this repo and expanded submodules.
- The private part of a deploy key for Automattic/vip-mu-plugins-built is encrypted against this repository (Automattic/vip-mu-plugins-built), meaning it can only be decrypted by Travis running scripts related to this repo
- This repository and it's submodules are checked out, again, to start the build
- All VCS config and metadata is removed from the build
- Various files are removed, including the
.travis.yml
containing the encrypted private part of the deploy key - The Automattic/vip-mu-plugins-built repo is checked out
- The
.git
directory from theAutomattic/vip-go-mu-plugins-built
repository is moved into the build directory, and a commit is created representing the changes from this build - The commit is pushed to the
Automattic/vip-go-mu-plugins-built
repository