G’day folks,
I’m giving the Bedrock stack a spin on my current project, and have almost got it working flawlessly! It’s great stuff!
My small problem relates to using wp-cli with the bedrock-ansible
Vagrant stack. Specifically, I can’t run wp-cli from my host OS.
Here’s how it is:
-
the host OS is running OSX
-
the guest VM is running
bedrock-ansible
-
the project repo is on the host OS, i.e. in
/my/dir
, and shared to the VM -
if I try to run wp-cli from the host OS, it cannot find the correct env vars it needs:
/my/dir$ wp db export
Fatal error: Uncaught exception ‘RuntimeException’ with message ‘Required ENV vars missing: ‘DB_NAME’, ‘DB_USER’, ‘DB_PASSWORD’, ‘WP_HOME’, ‘WP_SITEURL’’ in /my/dirs/vendor/vlucas/phpdotenv/src/Dotenv.php:63
Since bedrock-ansible
hosts these env vars outside the project, wp-cli can’t find them.
My question is: has anybody else found this problem, and have you found an elegant solution? Or, perhaps, am I missing something obvious?