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:
Setup
- 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.
Development
-
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 andcd
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?
Deployment
- 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?
1 Like
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?
1 Like
I highly suggest you read this thread, where I ask about running multiple projects.
Setup
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
.Vagrantfile
/trellis
/bedrock1
/bedrock2
.. 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.
Development
- 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 vagrant up
.
- 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 git@github.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.
Deployment
- 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.
5 Likes
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.
2 Likes
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.
2 Likes