How to manage multiple projects and keep up-to-date versions of Roots

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

  1. 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.
  2. 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

  1. 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