From db75710397746eaa93136766af50344fe9a62e49 Mon Sep 17 00:00:00 2001 From: Christopher Walton Date: Fri, 20 Jun 2025 18:43:03 -0500 Subject: [PATCH 1/2] Update entrypoint.sh Trying to fix the duplicate machines issue --- entrypoint.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/entrypoint.sh b/entrypoint.sh index f16a75c..19f5b05 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -70,9 +70,10 @@ fi # Trigger the deploy of the new version. echo "Contents of config $config file: " && cat "$config" -if [ -n "$INPUT_VM" ]; then +if [ -n "$INPUT_VMSIZE" ]; then flyctl deploy --config "$config" --app "$app" --regions "$region" --image "$image" --strategy immediate --ha=$INPUT_HA ${build_args} ${build_secrets} --vm-size "$INPUT_VMSIZE" else + fly machines destroy --force --app "$app" $(fly machines list --app "$app" --json | jq -r '[.[].id] | join(" ")') flyctl deploy --config "$config" --app "$app" --regions "$region" --image "$image" --strategy immediate --ha=$INPUT_HA ${build_args} ${build_secrets} --vm-cpu-kind "$INPUT_CPUKIND" --vm-cpus $INPUT_CPU --vm-memory "$INPUT_MEMORY" fi From c5eb5792b6004353f9b2cb2f3f1d4161132c19cc Mon Sep 17 00:00:00 2001 From: Christopher Walton Date: Fri, 20 Jun 2025 19:19:46 -0500 Subject: [PATCH 2/2] Fixed multiple machine issue Kill all existing machines before launching a new one. Also, fixed the INPUT_VM, which was eroneous. --- entrypoint.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/entrypoint.sh b/entrypoint.sh index 19f5b05..de736bb 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -71,6 +71,7 @@ fi # Trigger the deploy of the new version. echo "Contents of config $config file: " && cat "$config" if [ -n "$INPUT_VMSIZE" ]; then + fly machines destroy --force --app "$app" $(fly machines list --app "$app" --json | jq -r '[.[].id] | join(" ")') flyctl deploy --config "$config" --app "$app" --regions "$region" --image "$image" --strategy immediate --ha=$INPUT_HA ${build_args} ${build_secrets} --vm-size "$INPUT_VMSIZE" else fly machines destroy --force --app "$app" $(fly machines list --app "$app" --json | jq -r '[.[].id] | join(" ")')