simonw / datasette-publish-fly

Datasette plugin for publishing data using Fly
Apache License 2.0
20 stars 7 forks source link

Make --app optional #1

Closed simonw closed 3 years ago

simonw commented 4 years ago

Fly can generate random names for applications for you. I should make it an optional argument and let fly generate you a random name.

I should also have datasette publish fly output a command-clickable URL when it finishes (with an https:// prefix).

Refs https://github.com/superfly/flyctl/issues/82

simonw commented 4 years ago

Since the organization selection currently means that the first deploy HAS to have an interaction, I'm going to force an interaction here too.

If you don't pass --app the tool will prompt you for an app name. It will also tell you that you can hit "enter" to have Fly pick one for you.

simonw commented 4 years ago

This is proving difficult. The problem is that I can't automate the flyctl apps create command well enough. I tried writing code such that my wrapper script would prompt the user for an app name (showing them a list of their existing apps first) and allow them to hit "enter" to leave it blank - but if I do that then when I call flyctl apps create it ALSO prompts the user for an app name.

So the simpler solution here is just going to be leaving the dynamic app name assignment up to the flyctl apps create command.

simonw commented 3 years ago

I'm going to leave this required. Experience with datasette publish cloudrun has shown that required is better here, since you really want people to think before accidentally over-writing an existing application.

Fly instances each cost a monthly allowance too, so encouraging people to create them at random with random names could get expensive!