Couldn’t fit an entire title for the question(s) I have. I can edit a better one later for future reference if anyone comes up with a better one. This is sort of a series of questions I have concerning best practice, setup, workflow, and deployment. I’m using Sage/Bedrock right now on a personal project and I’m liking it a lot. I’m considering using the Roots workflow on future client projects but don’t have any idea how to manage multiple projects in a sane manner. I’m coming from a MAMP workflow but have dabbled with Vagrant and understand it for the most part. I’m a front-end dev also so some of the stuff I find in the Roots/Sage/Bedrock docs can be intimidating at times. I plan on deploying these client sites to a WP-Engine install so that adds some limitations to a full circle Roots workflow/install, but here are some questions I have that I’ll try to categorize:
- What’s the most efficient way to mange multiple projects on my local computer? Right now I have a personal project with the ‘bedrock-ansible’ and ‘site’ folders in the root of it. Should I have a default folder with a bunch of projects within that that also contain the ‘bedrock’ and ‘site’ folders? I’m used to the MAMP folder structure i.e., a folder – ‘htdocs’ – and all project folders inside of it.
Do I have to run
vagrant up everytime I want to jump back on a project or is Vagrant always running in the background, like MAMP is? On my personal project I’ve noticed that sometimes when I come back to my computer and run
gulp watch nothing happens. Right now I have to exit that command and
cd to the folder that holds the Vagrantfile and
vagrant up then
cd back to my theme folder and
gulp watch again. Any workaround for this, or am I doing something wrong?
What’s the best way to develop with the Sage theme? I copied the Sage/Bedrock example from Github, renamed the theme folder and started developing from there. How should I be updating my entire Sage project when new commits and updates are made to Sage while keeping my theme changes intact?
- Like I mentioned earlier I plan on deploying to WP-Engine so their will be limitations to my deployment process and folder structure if I’m understanding everything correctly. Has anyone had any experience with a Sage/Bedrock project and WPE?
I’ve been working hard these past few days to migrate away from WPEngine, moving to DigitalOcean, so I can’t help you there, but as to the dev questions:
The VirtualBox Vagrant images should stay running so long as you don’t restart the computer, but the last time I checked, you couldn’t run multiple ones at the same time without editing the ip address during setup, and I was never sure how to do that. So my workflow is to cd into the directory of the site I’m not working on, vagrant suspend, then cd into the folder I am working on, vagrant up.
You could create a bash script that does it all for you, maybe take some variables to begin (site to suspend, site to launch), and save yourself some typing.
As to developing with Sage, I still find this hard to deal with, I think at a certain stage, you just need to let go of keeping it inline with the repo, and make it work for you. Anyone else have input?
I highly suggest you read this thread, where I ask about running multiple projects.
It doesn’t matter where on your computer you place your sites. It is not like with MAMP where you have to place projects inside a specific htdocs folder in order for them to work with the webserver. After getting help in the thread I linked above, I’ve setup a structure where I have one trellis (a.k.a. bedrock-ansible) installation with multiple sites which I want hosted on the same Digital Ocean droplet. It looks something like this;
- My project-folder
.. and so on
Where all of the
bedrock folders are git clones of the bedrock-repo. Each time you add a new site you will need to add it to your
group_vars/ files as a new object inside
wordpress-sites and then run
vagrant reload --provision. Notice that the
.Vagrantfile has to be moved up to the root of the project, as done in the roots-example-repo. I then created one git repo in the root folder which has everything except /trellis and .Vagrantfile in .gitignore. I also create a new git repo inside of each bedrock folder, as this is needed for deploys via Trellis.
- As @evanfuture says – as long as you haven’t restarted your computer or ran
vagrant halt or
vagrant suspend you shouldn’t have to run
- Sage is a starter theme and you don’t actually need to keep it aligned with the original repo, but if you wanted to follow along you could add the roots repo as another remote called upstream using
git remote add upstream email@example.com:roots/sage.git. This might be a bit tricky if you use the setup I use, since each of your sage folders will be inside one of the bedrock repos, but @swalkinshaw has eluded that it could be done. Search stack overflow.
- No experience of WP-Engine. I totally recommend DigitalOcean however, and I’m not really sure why you would use WP-Engine as Trellis configs everything for you. To be honest, I’m not really sure that a Trellis based setup would be able to deploy to WP-engine as I guess they don’t supply vanilla Ubuntu 14.04 servers.
Thanks, let me know how your migration goes. I’m thinking about doing the same sometime in the near future. Just don’t know how demanding it will be.
To be honest, I’m not really sure that a Trellis based setup would be able to deploy to WP-engine as I guess they don’t supply vanilla Ubuntu 14.04 servers
The problem with deploying from a Bedrock site to WP Engine is with Bedrock’s directory structure…WP Engine uses the default WP directory setup. I think I remember someone created a bash script that will reorganize the folders to WordPress’s default setup.
Yea I saw that. I might give it a try or just make the switch DO. The thing is I’ve never set up a server, but from I read it’s pretty easy to setup a DO droplet. I build lots of Woocommerce sites and like to always keep security and performance in mind when building a site. WPE does a good job at doing all of that on the server side for me. I prefer to stay away from most server side stuff but if DO is pretty easy and if it can eliminate unnecessary cost for future clients then I’m in.
A single site migration was very simple, though it required a database-synching plugin which is outside the scope of Trellis. I’d say the whole process only took me half an hour once I worked out the kinks. Thank goodness too, as I had five sites to transfer over.
I’m working through a more complicated migration at the moment, where I have on Trellis install/server managing five sites. That’s so I can keep them all on one DO droplet and save money. The setup required a bit more fiddling, but I’m finally at the deploy stage, and its going well so far. PM me if you need any advice along the way.
While DO might be “easy” becoming the admin of the server is not, especially when you’re managing ecommerce sites with SSL + security + PCI and liability issues. Though I’d say if you want to learn it’s definitely worth it.