icefoganalytics / elcc-data-management

Data Management application for Education's Early Learning Child Centre
Apache License 2.0
0 stars 0 forks source link

ELCC-23: Make Automated Migrations Run In Production #56

Closed klondikemarlen closed 11 months ago

klondikemarlen commented 11 months ago

Fixes https://yg-hpw.atlassian.net/browse/ELCC-23

Context

See https://github.com/icefoganalytics/travel-authorization/pull/67 and and whatever code is currently running in the travel-authorization project.

Implementation

Move migration pipeline from bash + MSSQL to TypesScript/JS. Make pipeline run in production. NOTE: the seeds are per-environment, so there are no seeds that run in production currently, only in development.

Testing Instructions

  1. Boot the production version of the app locally via docker compose up --build
  2. Check that the app complies, and that you can log in at http://localhost:8080.
  3. Check that the initializer pipeline waits for the database to come up before running.
  4. Run the development seeds manually via:
    dc exec app sh
    NODE_ENV=development node
    const { runSeeds } = require("./dist/initializers/30-run-seeds.js")
    runSeeds().then(console.log)
  5. Go to http://localhost:8080/dashboard and check that there are 2 child care centres.