Possible to push an image to registry.fly.io before an app exists?

So it turns out that my Terraform + GraphQL approach assumes that it’s possible to push an image to registry.fly.io before running the launchApp GraphQL mutation.

Is it possible to make this work somehow? My current build + deploy setup is:

  1. build with bazel
  2. push any containers to docker registry
  3. render terraform modules
  4. run terraform apply

I need terraform to do things like create DNS entries, S3 buckets, IAM keys and other things that affect my fly app secrets.

If at all possible I’d prefer to avoid introducing an additional flyctl step after terraform apply.

Unfortunately an app needs to exist before you can push to it’s repo. However you can deploy from another app’s repo in the same org. Would it work to first push to another app’s repo then create the app?

I might be able to make it work. Is it possible to use a single app for all images you want to push for any other app you might deploy in the organization?

Yeah that would work.

One other thing you can consider is just stubbing out the app with createApp before you deploy. This will let you “stage” secrets and other configuration options, push to the registry, and then deploy separately.

Unfortunately because of various bazel constraints the push has to happen before we know the secrets or other configuration options.

I’ll probably need to do a single dummy app that’s a catch-all for every image that will be needed.