-
Hey, thanks for releasing pre/post deployment support. Unfortunately, I'm having a hard time understanding exactly how these are supposed to be used to run migrations. Is there any documentation/examples that show how to use this feature? Right now, I only see that it says "point to a buildspec", but I have no idea what is supposed to be in that buildspec. I've come up with this as a buildspec:
However, this relies on a job being deployed that's schedule to none. The issue I'm having is the job is not updated as apart of the pipeline so the job is just running whatever I deployed originally, at least for the pre_deployments phase. It also feels bad to have a job deployed with no schedule just to run these. Is there anyway to just get the dockerfile and run it directly with vpc/secrets set up? What is the recommended way to accomplish this? Thanks! |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 10 replies
-
Hello @jetaggart.
This is very true. I think the problem right now is we don't have a manifest for one-off task and we don't have feature parity as job. However, I think your setup is the one I would have right now for DB migration as well.
I don't understand why you think it has this issue: if your job is in the same workspace, it should be rebuilt and the image would've been pushed to the ECR at the build stage. Then, the latest image for the job should be used in the |
Beta Was this translation helpful? Give feedback.
-
Hi, as a follow-up to this question, how do we actually specify the command to be run (e.g. |
Beta Was this translation helpful? Give feedback.
I figured out how to solve for this, although still feels hacky. In the pipeline build phase you can change it to go off the SHA of the commit when tagging the image, so change this line in the pipeline
buildspec
to
and in your migrations buildspec, use that image instead of
latest
: