nymedia / ansible-drupal-deploy

0 stars 0 forks source link

Atomic (ish) deployments #2

Open eiriksm opened 1 year ago

eiriksm commented 1 year ago

What do you think about getting some form of atomic deployments in here?

Drupal is not great at atomic deployments, given database updates and so on, but some deploys might actually be possible to rollback. So if we deployed to /var/www/builds/ababafefef2323 (hash of tag, for example) and always symlinked /var/www/html to the latest build, we could do instant rollbacks by just relinking things. And of course, this makes it possible to automate the process as well

It's also possible to roll back with database restore, if something went horribly wrong in a deploy with database updates

Just a question at this point. I don't see us having this problem a lot, so a discussion around effort vs usefulness is relevant here

esolitos commented 1 year ago

FYI: My long term plan is to phase-out the git deployment in favour of containers, I am adding the git-based support for deployments to ease the transition and to tackle 1 problem at the time (moving customers to own account).

That said, adding this should not be much of a problem, it is a straight forward implementation. The main caveat would be that we should restart nginx + php-fpm to ensure there are no open file descriptors.