Skip to content
This repository has been archived by the owner on Nov 13, 2024. It is now read-only.

Rolling databases per builds #253

Open
gregharvey opened this issue Aug 3, 2018 · 0 comments
Open

Rolling databases per builds #253

gregharvey opened this issue Aug 3, 2018 · 0 comments

Comments

@gregharvey
Copy link
Member

From @pm98zz-c in our internal system:

I've been floating this for quite some times, but it looks like never opened a ticket.

So, in a nutshell, the plan would be to replace the db backups we take pre-build with actual db 'copies', one per build. This would allow proper and automatic reverting of failed builds to the matching db: on codebase tied to one version of the database.

How this could work:

  1. We need to change the naming convention for db names to 'project_buildtype_buildnumber'.
  2. At the start of each build create a new db for the new build, and 'mysqldump project_buildtype_123 | mysql project_buildtype_124'
  3. Point the settings file to the matching db. This could be far simpler than the current system: by copying a "template" from /var/www/config directly as sites/default/settings.php, replacing a few tokens as needed (buildtype, buildnumber). This ensures the codebase for a given build always references the right db. It also mean we would not have anymore issues with commands run 'before or after' the symlink switch: command ran in a given build codebase would be against the matching codebase.
  4. Reverting in case of failure just means switching the symlink back: instant revert of both the code and the database.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

1 participant