This makefile automates the process of setting up a development environment from a shared Git repository. In this workflow, only your theme files are included with the projects.
All dependencies, including Wordpress core and supporting plugins, are installed via the Makefile. It also bundles WP-Cli and PHPUnit in your project directory.
This workflow is a work in progress and offers a lot of room for improvement.
DIR=$HOME/Sites/example-site.dev;
git clone [email protected]:username/example.git ${DIR};
cd ${DIR};
make;
git config user.name "Your name";
git config user.email "[email protected]";
mysql -u root -p;
CREATE DATABASE example_site;
Run make db
to configure wordpress, activate theme, plugins, and set options.
- Log in to Wordpress via wp-admin.
- From Settings → Permalinks, set the structure to Month and Name. This also creates an .htaccess file for you.
- Import content from a production environment using a Wordpress WXR file.
- Run
make test
to run unit tests.
Why not use Composer?
I haven't found a good way to automate changes with Composer when doing automated Git deployments. Perhaps down the road.
How do I use the bundled copy of WP-Cli?
/wp-cli/bin/wp
is symlinked to ./wp
. You can use either command.
How do I use the bundled copy of PHPUnit?
It is included as a .PHAR file. Just run ./phpunit
or make test
.