-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update deployment to run migrations as a separate step #1778
Update deployment to run migrations as a separate step #1778
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it was so convenient having this script here I decided to just sym link it to its new location
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is just a rename--the symlink i made to it confused github
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is just a rename--the symlink i made to it confused github
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let’s see it in action!
infra has been deployed to staging and prod, and I confirmed the new boxel-pg-migrate ECS service is running. feel free to give it a shot. like i said, I'm not too sure that the workflow updates will be picked up outside of the |
I think you’re right about this PR’s workflows not being used in deployment but I’ll try it to confirm. |
Ah, I see an error in the docker image:
|
…n-of-database-migrations-to-dedicated-actions
This PR adds support to run DB migrations as a separate step. In this PR I introduce a new Docker file that allows the migrations to run completely independent from the realm server (having a separate postgres workspace worked out really nicely).
In this PR I actually make running the migrations automatically a flag that we set on the command line. Keep in mind that we want our tests to use the latest schema (the tests run in their own DBs). This also extends to matrix tests too. I opted to let the local dev version of the app auto migrate as well since that seems to work pretty well for our current dev experience. we can make that an opt-in feature if we want, but I'm guessing that most devs will want auto-migrate. it's one less thing to have to troubleshoot when things break (disabling auto migrate in your dev env is also quite simple). The hosted env's, though, do not auto migrate, and instead rely on the newly introduced migration deployment step for their migrations.
This PR depends on the infra PR https://github.com/cardstack/infra/pull/559 which provides an ECS service for the pg migration script to run in that is independent of the realm server.
As part of this I found a bunch of issues when we separated out the postgres workspace from the realm server in that specifically the migration related scripts in the realm-server workspace didn't work anymore. those actually needed to move over to the postgres workspace. I also had to tweak the
drop-all-dbs
to work using the new postgres workspace, which i renamed tofull-reset
to be more clear what it actually does.TODO: