PDX WordCamp 2017 – Trellis, Bedrock and Roots.io Follow Up

I had a great time last weekend at WordCamp PDX 2017 presenting an overview of Trellis and Bedrock — two projects under the Roots.io umbrella. If you missed the talk, I’ll give an update whenever the talk is uploaded to WordPress.tv.

The slides for the talk are publicly available on Google Drive.

Additionally, I created an example repo which outlines a number of steps covered in the presentation. Later commits were not a part of the presentation, and touch upon using Trellis to:

  • Provision and deploy to Production
  • Encrypt the vault.yml files in order to share the site with others, without allowing them to provision and deploy.

If you have questions, hit me up on Github or Twitter

Additional Clarification

There was one question along the lines of:

How do these projects enforce PHP versions?

My response ok, but let me attempt to improve on it:

Using Bedrock to manage our WordPress code, we are creating a new composer package. By declaring a dependency along the lines of “this site package requires at least this version of php”, we can ensure that our ‘package’ (ie our site) will fail if the dependencies are not met. This helps us quickly determine and meet the dependency that is lacking (ie, update to a more recent version of php).

Remember that Bedrock doesn’t require Trellis, it’s only concerned with the dependencies of our WordPress site. Because of this, our ‘site package’ can run anywhere the dependencies are met — “Nginx, Apache are fine, but we need at least this version of PHP”.

On the Trellis side, you “can” change the version of php. However, running the most recent version of PHP has so many benefits, predominantly the speed boost, that the effort of downgrading Trellis’ version of php may not be worth it.

Still, if you are undeterred, I recommend looking at the Ansible role controlling the installation of php:

The Trellis VM is an Ubuntu machine, so any adjustments you can make normally with the shell can be done with Ansible.

I hope that helps clarify things, and if you are in PDX and want to learn more, let’s setup a co-hacking event to share our knowledge!