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

Rolling databases per builds #253

@gregharvey

Description

@gregharvey

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.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions