flyctl with multiple fly.toml files

Is there a way to tell flyctl to pick up fly2.toml on launches and deploys instead of the default fly.toml?

I think you would just have to rename the fly2.toml to fly.toml and move/delete the old fly.toml.

The flyctl will only run the file labeled ‘fly.toml’ file

1 Like

Looking at flyctl code, it probably shouldn’t be hard to add support for this.

Another approach that would work for us is if fly.toml supported environment-specific config, like say dev, staging, prod, v1, v2 etc. Is that in the pipeline?

I’m aware there’s a way to do per-PR deploys, but that is quite what we are looking for.

Would the --config flag be what you need?

Haven’t tried it myself but maybe it’s as simple as fly deploy --config fly2.toml?

1 Like

flyctl with --config switch should work! Let me try it the next time I’m at my desk.

Thanks!

1 Like