Closed felixxm closed 5 months ago
Thanks Mariusz! Are you planning to do anything more with this project at the moment? I will be coming back to this shortly, and can share a clearer idea of where I'm heading with it if you are interested.
Are you planning to do anything more with this project at the moment?
I wanted to check how it works from a Fly.io perspective and if there was anything we could incorporate into flyctl
to make deployment smoother for Fly.io users.
I will be coming back to this shortly, and can share a clearer idea of where I'm heading with it if you are interested.
Sure I am.
I wanted to check how it works from a Fly.io perspective and if there was anything we could incorporate into
flyctl
to make deployment smoother for Fly.io users.
I'm looking through the fly_io/deploy.py file, which is the main file that handles fly-specific configuration.
One issue I faced was finding that some fly
commands accept the --json
flag, and others do not. It's much more reliable to parse JSON output, so it's really nice to find commands that support that flag. The commands I needed to use that don't support --json
are:
fly secrets list
fly postgres users list
fly apps open
If you can implement --json
support for every command that generates output, then all output could be handled consistently and reliably in automation code.
The second issue deals with connecting apps and databases. In the standard workflow:
<app_name-db>
;I check for an existing database that matches the app name before creating a new database, for a variety of reasons. Is there a way to check if an existing database is already connected to an app? I'd love to run a command that would tell me the name of a database that's attached to an app. That would be more reliable than just looking for an existing database that matches my naming convention.
Support for json
in fly postgres users list
, should be fixed soonish, https://github.com/superfly/flyctl/pull/3322.
Is there a way to check if an existing database is already connected to an app?
You can check if DATABASE_URL
is in fly secrets list
, that will give you a 0-1 answer.
As far as I'm aware, it's not possible (easy) to find a database name. For PostgreSQL you could try to check
flyctl postgres users list -a test123
Thanks, this is really helpful! Cleanup work noted in #290.
About fly apps open
, unfortunately, it works only not a "happy path" so it always opens http://{APP_NAME}.fly.dev/
, you can do the same by getting an app name from fly config show
and building this URL on your own.
Thanks again, I will give that a try.
Required since 7d1d405385d266861eb284eed2f72b4da87d35e4.