I have a GitHub action workflow that launches a new Fly instance every time a new branch is created and pushed.
As of a week ago, this workflow broke due to apparent changes in flyctl.
The workflow used the following Fly command:
flyctl launch --path ./packages/api --now --org [my-org] --copy-config --name [my-new-branch-name] --region lax"
My fly.toml:
# fly.toml file generated for paragraph-colintest5 on 2022-10-25T09:29:42-07:00
app = "paragraph-master"
kill_signal = "SIGTERM"
kill_timeout = 60
[build]
builder = "heroku/buildpacks:20"
[env]
PORT = "8080"
[experimental]
auto_rollback = true
cmd = ["exec", "/workspace/start-docker-container.sh"]
[[services]]
internal_port = 8080
protocol = "tcp"
script_checks = []
[services.concurrency]
hard_limit = 2000
soft_limit = 1500
type = "requests"
[[services.http_checks]]
grace_period = "10s"
interval = "60s"
method = "get"
path = "/health"
protocol = "http"
timeout = "1s"
tls_skip_verify = false
[[services.ports]]
handlers = ["http"]
port = 80
[[services.ports]]
handlers = ["tls", "http"]
port = 443
[[services.tcp_checks]]
grace_period = "10s"
interval = "60s"
restart_limit = 6
timeout = "1s"
Now, when I ran the command (or when the GitHub action workflow gets triggered), I’m prompted for a Dockerfile even though I was using a buildpack. The command is not proceeding, and thus the GitHub action workflow fails. It doesn’t appear I can ‘auto-confirm’ everything.
Here’s the command and prompt:
➜ flyctl launch --path ./packages/api --now --org paragraph --copy-config --name colin-test4 --region lax
An existing fly.toml file was found for app paragraph-master
Creating app in /Users/colinarms/src/papyrus-monorepo-v2/packages/api
Scanning source code
Detected a Dockerfile app
? Create .dockerignore from 1 .gitignore files? (y/N)
It would be great if…
- I wouldn’t need a Dockerfile - I didn’t need one before; Heroku buildpacks worked fine. I don’t know what changed.
- I could run the command and force it to accept everything (eg similar to flyctl deploy --auto-confirm)
- Even better, if there was a way I could just
flyctl deploy --create-app
and the app gets created if it doesn’t exist. This would avoid the need of usingflyctl launch
entirely
If there’s any better way to auto-create and auto-deploy a new Fly app upon branch creation, please let me know!