Roots Discourse

Deployment Strategy After Update to Trellis

I updated Trellis today, merging upstream master into my local branch (fixing a few merge conflicts :slight_smile: ). This because I was getting an error relating to my ansible version when I was trying to deploy an update to wp to production: ERROR! Unexpected Exception, this is probably a bug: No module named six

A bit of google revealed the ansible issue, which led me to https://github.com/roots/trellis/pull/895, and to the thought that I could try updating trellis.

I blew away my local vagrant destroy and then rebuilt. All appears to be well on my local installation.

There are some significant changes including an uptick in php version with the new Trellis.

In this case, and in regards to pushing these changes up to production, should I reprovision and redeploy, redeploy only, gut a goat and pray for rain, etc?

Thanks.

1 Like

Provisioning: Preparing the server system for (WordPress) sites, including site-specific configuration (domains for the site, HTTPS, server specific configuration).

Deploy: Pushing the (usually Bedrock based WordPress) site code and config (e.g. .env for PHP ini settings), uploading built (e.g. sage) theme, installing WordPress plugins using composer file, etc, what happens in the deploy scripts.
Trellis also supports multiple releases, being able to roll back to a previous release of a site.

For changes in trellis, usually a reprovision (ansible-playbook run) is necessary.
ansible-playbook is usually idempotent which means
you can just re-run it as many time as you need or deem fit.

Depends some on how out of date your previous Trellis version was. :wink:

In my experience if your server is already provisioned then you can still deploy without reprovisioning. Of course, if you want any updates that a new Trellis provides (i.e. that PHP version bump) you’ll need to reprovision. If you do upgrade PHP, keep in mind that you may have to manually restart the PHP service. Usually I don’t bother reprovision a remote with updated Trellis, unless I’ve merged in Trellis changes to add a feature I need it fix a bug/plug a security hole. I updated Trellis and ran deploys without reprovisioning on 4-5 sites last week, and they all handled it fine.

Of course, backups are always a good idea when reprovisioning. On Digital Ocean I usually take a live snapshot before I run a reprovision.

Thanks for the replies folks. Got this done after some down time with the flu. I decided to do a test run on a staging server, which I set up. Had a few hiccups along the way as I haven’t actually created a new machine since i provisioned and deployed my production instance.

About the only issue I had on the staging site was when I deployed and the build-before.yml gulp task failed. I fixed that by blowing away node_modules folder locally and reinstalling everything (npm install i believe was the command).

Then i got brave and provisioned in production, after taking a snapshot as suggested by @alwaysblank. No issues presented themselves with that, so I deployed as well.

This whole thing started when I tried to deploy the 4.9.2 update to production. I went the long way round to get that sorted.

1 Like