From f7152c133b1fe7767b6e549ca09598655c1f8ca4 Mon Sep 17 00:00:00 2001 From: Jon Phenow Date: Wed, 16 Oct 2024 16:16:18 -0500 Subject: [PATCH] Configure additional launch options at create (#69) * optionally attach additional options to the initial fly launch command * add readme --- README.md | 1 + action.yml | 2 ++ entrypoint.sh | 2 +- 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 04f6d4e..e4f3510 100644 --- a/README.md +++ b/README.md @@ -24,6 +24,7 @@ If you have an existing `fly.toml` in your repo, this action will copy it with a | `cpukind` | Set app VM CPU kind - shared or performance. Default shared. | | `memory` | Set app VM memory in megabytes. Default 256. | | `ha` | Create spare machines that increases app availability. Default `false`. | +| `launch_options` | Attaches additional options to fly at app creation if specified | ## Required Secrets diff --git a/action.yml b/action.yml index 0748d75..d3b8882 100644 --- a/action.yml +++ b/action.yml @@ -38,3 +38,5 @@ inputs: ha: description: Create spare machines that increases app availability (default false) default: false + launch_options: + description: Additional options to pass to the Fly launch command at creation diff --git a/entrypoint.sh b/entrypoint.sh index 6719a6f..2c02ad7 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -40,7 +40,7 @@ fi if ! flyctl status --app "$app"; then # Backup the original config file since 'flyctl launch' messes up the [build.args] section cp "$config" "$config.bak" - flyctl launch --no-deploy --copy-config --name "$app" --image "$image" --region "$region" --org "$org" + flyctl launch --no-deploy --copy-config --name "$app" --image "$image" --region "$region" --org "$org" $INPUT_LAUNCH_OPTIONS # Restore the original config file cp "$config.bak" "$config" fi