Development Setup
Lando is the official Conifer development environment, and comes highly recommended. It's the best local dev tool in the galaxy!
We also support Varying Vagrant Vagrants, although much of the tooling around testing etc. may require some tweaking depending on your setup.
Using Lando (Recommended)
First, install Lando if you haven't already. Your future self will thank you.
Clone
git clone git@github.com:sitecrafting/conifer.git
Note: Lando setups are self-contained, so it doesn't matter where you clone it to (as it would if using Vagrant, MAMP, or similar).
Start
cd conifer
lando start
The first time you start the app, it will install WordPress, Timber, and the Groot starter theme for you. Then it will expose your local Conifer dev site at https://conifer.lndo.site (or similiar).
WP Admin username: conifer
Password: conifer
That's it
Yup, that's pretty much all there is to it.
Recommended next steps:
- If you're new to Lando, we suggest reading the Overview, and then the WordPress recipe tutorial. Conifer uses the WordPress recipe under the hood, so it's useful to know what's going on.
- Run
lando
with no arguments to see/verify custom tooling commands (also see Custom Lando Tooling, below) - Log in to /wp-admin to verify the credentials you set up
- Explore the testing setup
- Start hacking on Conifer! 🌲 🚀 🎉
Custom Lando Tooling
Conifer's Lando environment comes with several goodies for making local development a breeze.
CLI commands
Along with the universal Lando commands, we get these commands for free from Lando's built-in WordPress recipe:
lando wp
: run WP-CLI commandslando composer
: run composer commandslando db-import <file>
: Import a WordPress database from a .sql or .sql.gz file. The file must be inside your Conifer directory tree!lando php
: run arbitrary PHP commandslando mysql [wordpress]
: drop into a MySQL shell (wordpress
is the name of the database Lando installs for us)
Conifer's Lando setup also provides these commands:
lando unit
: run Conifer's PHPUnit test suitelando e2e
: run Conifer's end-to-end Cypress test suitelando cypress
: run arbitrarycypress
commandslando sniff
: run PHPCS on the Conifer codebaselando debug
:tail
the WP debug.log in real timelando yarn
: run arbitrary yarn commandslando docs
: build the Conifer doc site being served from thedocs
service (https://docs.conifer.lndo.site or similar)lando gitbook
: Run arbitrary gitbook commands.
Serving a local documentation site
If you're working on docs, it's helpful to see the doc site as compiled from your exact copy of the Markdown files.
To that end, you can run lando docs
to build the docs site once.
It's annoying to do that over and over, though. To rebuild the docs automatically whenever a Markdown file changes, run lando gitbook serve
. This will start a process and block your current shell session; press Ctrl-C
to exit the process.
Warning: The localhost URL in the output is misleading
The gitbook serve
command starts a web server at localhost:4000
, but this is actually the localhost
inside the docs
service container, meaning you can't actually view the doc site at that address. Go to the proxy URL output by lando start
or lando info
instead. This will be something like https://docs.conifer.lndo.site.
Mailhog
Conifer's Lando environment also includes a Mailhog instance for catching and managing outgoing mail at https://mailhog.conifer.lndo.site or similar
The URL may be different depending on which ports are already take on your computer. Run lando info
to see the actual URLs.