I’m setting up a Github Action to automatically deploy a fly app, and I’d like to run the associated Prisma database migration as part of that. When running locally, I open fly proxy 5432 in one terminal, and DATABASE_URL=...localhost... prisma migrate deploy in another one, but of course Github Actions don’t have multiple terminals, and running a pipeline with fly proxy 5432 & prisma migrate is likely to try to connect before fly proxy has actually finished the wireguard connection. Guessing a sleep duration is my next fallback…
What might be ideal would be to have fly proxy take a subcommand as an argument, spawn it once the wireguard connection is up, and then close the connection once the subcommand terminates.
Is something like that on the roadmap, or have other people found a better way to do this?
This is a problem for me too, I’d love to get a background flag like fly proxy --background 5432, that would wait to check the connection and error out if need be, and if connection is successful maybe output the pid as a common utility.