Roots Discourse

How to Install Wordpress on Staging and Production on first Provision

Is there a way that I can install wordpress on staging and production on the first provision like trellis does for development so that the install page is skipped after provision/deploy?

Not built in, no. The main difference for remote servers is you need to get your codebase on the server first which is usually done by a deploy. So you could automate:

  1. provision
  2. deploy
  3. install (via WP-CLI maybe)

Or you could modify the server.yml playbook to add a custom role/task which handle the last two steps automatically.

This is what I’m after… but I guess the main question I have is how would I detect if wordpress is already installed or not so that I don’t re-install wordpress when it already exists.

Here’s an example of how we check:

1 Like

Thanks @swalkinshaw I got it working perfectly.

This topic was automatically closed after 42 days. New replies are no longer allowed.