Hi!
Is there a good way to deploy one codebase to several fly applications? I’ve figured out that you can configure all the commands with the -c
option to point to a specific configuration file, but that’s not proving very handy.
I’m in the situation where I have one codebase, and I have separate applications for production/acceptance/etc.
Thanks in advance!
Hi @linusdm
One option (which we use) is to create fly.toml files then remove the app name from the file. You can then specify the app name using the --app
cli option. If you have a CI/CD pipeline you can configure it with the required app names, e.g. fly deploy --app myapp-staging
To add to charsleysa’s answer: There’s only about a handful number of ways monorepos can be made to work with Fly, and that’s documented here (assuming you haven’t stumbled upon it): Monorepo and Multi-Environment Deployments · Fly Docs
Thank you for these replies!
I hadn’t seen that particular documentation page.
Another tip I got was to put the things that very in fly secrets (which is a bit of a hack, but does the trick).
We have a setup similar to the one @charsleysa mentioned, except that we push a built image to the Fly registry first then deploy it to two separate apps: prereview.org/ci.yml at b76d3c1b414ace6512f2572274fd25d7b72df86a · PREreview/prereview.org · GitHub
Wow, that’s a nice setup. Requires only building one image, for both environments.