Using bedrock and sage without trellis

Hello,
I’ve been looking into using bedrock to manage our site plugins better and make local development a bit easier than having to manually copy a new instance of wp then cloning the theme etc…
However i can’t seem to find any information as to go about setting up a new site repository.
In my head what i feel should be possible is to :

  • Clone bedrock
  • Clone sage into the theme folder
  • Composer install from the repository root
  • Make changes to the theme and store both bedrock and sage to one repository for each site built

However following this you have to composer install both in the site bedrock root and inside the site theme root causing you to have 2 vendor directories which feels wrong.
Can anyone shed some light on this ? I tried reading through the GitHub - roots/roots-example-project.com: Example Roots stack project (Trellis, Bedrock, Sage) example however this is using trellis aswell and i have not got any experience with ansible.
This does state
Here’s how this example project was created:

Create a new project directory: $ mkdir example.com && cd example.com
Clone Trellis: $ git clone --depth=1 git@github.com:roots/trellis.git && rm -rf trellis/.git
Clone Bedrock: $ git clone --depth=1 git@github.com:roots/bedrock.git site && rm -rf site/.git
Clone Sage: $ git clone --depth=1 --branch sage-8 git@github.com:roots/sage.git site/web/app/themes/sage && rm -rf site/web/app/themes/sage/.git

So it seems that this workflow is possible, is it a case of having to have ansible to manage the dependencies of the theme aswell as the plugin dependencies of bedrock ?
Any help would be greatly appreciated.

2 Likes

Hey, you might check this post out -

I set Bedrock up on Scotch Box a while back to simulate installing on shared hosting. YMMV as that’s a pretty old post, but it may point you in the right direction.

Hi smutek, i couldn’t see anything in that post about using the sage theme ?

Hi, sorry if I misunderstood, but once Bedrock is installed I would just follow the regular instructions for installing Sage.

Even when using Trellis, plugins are still managed via the Bedrock directory, and its composer.json - you’re not seeing the Sage vendor directory on the example project because it’s git ignored. I think the composer.json in Sage is primarily for theme setup, rather than ongoing management. It’s fine to ignore it.

Hope that was helpful.

1 Like