From 372a8fcc09d83f0210be78687813a9ef4cfde339 Mon Sep 17 00:00:00 2001 From: Joshua Sierles Date: Tue, 1 Feb 2022 18:24:35 -0600 Subject: [PATCH] Speed up deploys by using a remote builder unless local is specified explicitly --- entrypoint.sh | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/entrypoint.sh b/entrypoint.sh index d16eba5..b333ce9 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -5,7 +5,19 @@ if [ -n "$FLY_PROJECT_PATH" ]; then # Allow user to change directories in which to run Fly commands cd "$FLY_PROJECT_PATH" || exit fi -sh -c "flyctl $*" + + +# Default to deploying with a remote builder unless local is specified explicitly +STRATEGY="--remote-only" + +for i in "$*" ; do + if [[ $i == "--local-only" ]] ; then + STRATEGY="--local-only" + break + fi +done + +sh -c "flyctl $* $STRATEGY" ACTUAL_EXIT="$?"