Skip to content

Add workflow to automatically generate SQL database dumps#105

Merged
dkayiwa merged 1 commit intoopenmrs-emr3from
automate-db-dumps-workflow
Feb 26, 2026
Merged

Add workflow to automatically generate SQL database dumps#105
dkayiwa merged 1 commit intoopenmrs-emr3from
automate-db-dumps-workflow

Conversation

@dkayiwa
Copy link
Member

@dkayiwa dkayiwa commented Feb 26, 2026

Summary

Adds a manually-triggered GitHub Actions workflow (Generate SQL Database Dumps) that automates the creation of the SQL dump files in src/main/db/.

How it works

  1. Builds the OpenMRS distribution using the SDK (generate-distro + build-distro)
  2. Starts Docker containers (OpenMRS + database)
  3. Waits for full initialization (Liquibase migrations, module startup)
  4. Runs mysqldump to create the SQL dumps
  5. Opens a PR with the updated files

Usage

Go to Actions → Generate SQL Database Dumps → Run workflow. You can optionally override the RefApp and OpenMRS Core versions; defaults are read from pom.xml.

Files added

  • .github/workflows/generate-db-dumps.yml — The workflow definition
  • scripts/generate-db-dumps.sh — Script that handles Docker lifecycle and mysqldump for each mode (demo/empty)

What this replaces

The manual process documented in the README:

mysqldump --single-transaction -u root -p openmrs > demo-db-3.4.0.sql

Add a GitHub Actions workflow (generate-db-dumps.yml) that can be
triggered manually to generate the demo and empty SQL database dumps
from a fully initialized OpenMRS Docker instance.

The workflow:
- Builds the OpenMRS distribution using the SDK
- Starts Docker containers for OpenMRS
- Waits for full initialization
- Runs mysqldump to create both demo and empty database dumps
- Opens a PR with the updated SQL files

Also adds scripts/generate-db-dumps.sh which handles the Docker
lifecycle and mysqldump execution for each database mode.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@dkayiwa dkayiwa merged commit 581efaf into openmrs-emr3 Feb 26, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant