Correct or recommended way to use trellis

I have taken over the development of some sites making use of the roots development triage (trellis/bedrock/sage).

In the setup the previous developer left in place and that I eventually took over, he configured a single trellis directory that was responsible for handling the development/staging/production variables for each of the 5 or 6 sites that we have. And a sites directory where each of the sites is cloned/developed.

I have read several blog posts and pages where users would clone a trellis repo for each individual site that they are developing and deploying.

Basically, what is the recommended setup to run trellis as it was intended to be used by the developers?

Hi, Zach; welcome to Roots.

I definitely prefer having a separate copy of Trellis for each site I run. It means that I can update one without worrying about breaking the others, and I can share access to each repo with other developers without worrying about them accessing stuff I don’t want them to.

Keeping them separate also helps me keep focused.

Trellis can definitely support more than one site per instance, but I think it works best when it’s one site at a time.

1 Like

That’s what I was thinking as well after reading so many posts and instances of other users/developers utilizing it in that way.

I think the reason the original developer did it the way he did was for possibly streamlining and automating the updating/deploying process.

I don’t plan on changing away from this setup as the higher ups are talking about moving away from WordPress and making use of Drupal instead. I’m not exactly on board with this, but I’m sure you know how that goes.

Another question if you may have an answer. What is the best practice for updating trellis from rc1 to rc2?

I have been reviewing posts and articles for weeks and the recommendations are all overt he place.

So say I just wanted to clone the newest version of trellis. Dependency wise, I would just need to update ansible to 2.4. But configuration wise, what files would I need to transpose from the rc1 repo to the newly cloned rc2?

This is how I do it because I always screw up git merges. It’s not ideal, and you have to remember to back up your changes, but it gets the job done fast for me. Your configuration might be more complicated, though.

One of the recent gotcha’s I’ve had with this method are that group_vars/all/helpers.yml and group_vars/all/main.yml also need to be updated from the Trellis repo. It shows big ugly errors on provision and deploy otherwise.


Same. I always mess up when it comes to merging. I was thinking of just creating a new branch in git and cloning the new trellis version to it and then transposing over the files that are needed and attempting to provision and deploy that way.