Step by step for a new site with trellis, bedrock(needed?) and sage 9

So every now and then i try and create a new site with trellis, bedrock, sage X. And each time i try to follow the docs but i never get very far.

I guess i don’t follow how they work together or which of the many directories created should i use! I end up with multiple app, theme installations and composer projects and then give up.

Would be great if a few of my main confusions could be answered and maybe i can move forward.

I have read up on the various parts but i just can’t seem to get everything working together.

  1. Should i install trellis per client website or once for my machine and have all my sites added there? Normally i have a folder per client and have the Wordpress install in there.
  2. When i run vagrant ssh what do i do? I just have a /trellis/ folder in there.
  3. Should i be following the installation docs for trellis, bedrock and sage one after the other?
  4. Or are they alternative ways to create a vm and can work independently?
  5. Is there a combine step by process to get everything working together for a new test-site.com, wordpress install & new-theme?

I really want to get away from Mamp as its becoming so slow and buggy.

Many thanks in advance, D.

Hi,
I’m sorry you’re having some frustration with Trellis. Posts like this are helpful for figuring out what parts of the documentation are unclear so thank you for being so thorough. I’ll see if I can help out with at least a few of these:

A great place to look for some of these questions is the Roots Example Project, but I totally understand that “go look at that” isn’t always the most helpful response.

My best practice is to think about your development environment the same way you think about your production environment. Are you using separate servers for production? Hopefully yes, so your development environment should mirror that. One Trellis per project. That keeps things nice and tidy and you can commit the whole thing to Git, and share projects with other developers, or even with the client, without worrying about exposing other client information.

You shouldn’t need to do this often unless you’re running wp-cli commands. What is your use case here?

What you’re probably trying to find is where the Vagrant virtual machine keeps the site files. You can find those in /srv/www/your-domain.com.

The installation docs for Trellis also cover installing Bedrock (which it just a matter of git cloneing it). Sage is a different thing, so to set up a project using Trellis, Bedrock, and Sage, the useful docs to follow are those for Trellis and Sage.

Only Trellis creates a VM. All Bedrock is is a way of keeping WordPress in a directory and using Composer. It’s a cleaner way to install WordPress. There’s not that much else to it.

Not really, because we never assume that just because you’re using Bedrock, you’re necessarily using Trellis, or just because you’re using Trellis, you’re necessarily using Sage. I manage a number of sites with Trellis that use purchased themes.

Ultimately these are all tools that can help you build a project. You can use one, two, or all three of them.

Let me know if this helps and if you have any more questions.

1 Like

Thanks @MWDelaney!

So i can ignore the bedrock section of the roots site.

So basically i should have a folder on my machine ~/sites/ and every website i build locally first, even if different clients should go in there.

I guess following from the trellis docs running vagrant ssh would setup WP install and install the sage theme etc. using the domain name specified in .yml files.
The docs start fairly clear as in put this in terminal but there is a bit of a gap to getting a WP install running and to add the sage theme.

I did look at the roots-example but couldn’t connect it to the trellis setup.

Plus a bit stuck at the very first line.

Instructions

Here’s how this example project was created:

Create a new project directory:
$ mkdir example.com && cd example.com

Where should mkdir be done? ~/sites/ ?

2 Install theme components

What if i want a different name for the sage theme? I thought there was a process that created the theme folder and other info with the right folder & theme name/details in various json files.

I think the other thing that isn’t clear is local database name, login details. Where are these done?

Once i get a few more details i’ll try from the roots-example repo and see how i get on. I’ll leave staging/production setups for now.

Many thanks fo0r your help! I only have a bit of time to try these things out before i just need to get on with a job in the ways i’m used to. I’m very comfortable with the these setup itself but want to see what all the buzz around Trellis is.

D.