Creating, Init'ing, Launching ... oh my

I am confused as to the correct process for:

  1. app creation|update
  2. Whether an app must exist on the service before I can deploy it

There appear to be several similar commands for this flow: flyctl app create, flyctl init and flyctl launch

I think, once I have an ‘app’ (see below), I can generally flyctl deploy (that’s clear).

However, my desired (!?) flow is:

  1. Create a ./fly.toml
  2. flyctl deploy

But, experience suggests that, if there’s no equivalently named app on the service, e.g. flyctl deploy fails.

Can I start with no (!) deployed apps, write an ./fly.toml and issue a flyctl to create a new app?

My workaround flow is:

  1. flyctl launch --image=${IMAGE}
  2. Update ./fly.toml with desired spec
  3. flyctl deploy

After successfully deploying, if I delete the app (e.g. flyctl destroy or flyctl apps destroy) and then redeploy:

Deploying ${APP}
==> Validating app configuration
Error not possible to validate configuration: server returned Could not resolve App

I expect this to succeed.

On other platforms (Kubernetes, GCP, DO, Linode etc.), it’s generally possible to start by spec’ing an app (manifest) and then deploying it to a service.

Thanks for the feedback. You’re right this is confusing. There’s many old or similar commands lingering about that don’t make sense anymore.

We’re improving this right now… flyctl init will go away so there’s 2 ways to create an app. If you have source code, an image, or a fly.toml file, use the flyctl launch wizard to create, configure, then deploy in one pass. If you want to start from scratch, use flyctl apps create to create an app and initialize a default fly.toml file. After you have an app, flyctl deploy is how you deploy changes going forward.

We’re also going to make commands “just work” instead of throwing errors with obvious fixes. Eg just create the app instead of throwing a “Could not resolve App” when it makes sense.

We should have some of these fixes out next week.

1 Like

I’ll give that a whirl.

Thanks for the always prompt and helpful replies.

Feature request that flyctl commands always include the object|noun.

i.e. when applied to apps:

flyctl apps create
flyctl apps deploy