From 469564a40541b12f30a32b5f0d4316e303cd6a86 Mon Sep 17 00:00:00 2001 From: Ege Demir Date: Tue, 13 Oct 2026 12:42:22 +0000 Subject: [PATCH] Keep only the upload directory line from the first SSH connection Co-Authored-By: Claude Opus 5.5 --- infra/deploy.sh | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/infra/deploy.sh b/infra/deploy.sh index 9f157a49..58fdf1c3 100755 --- a/infra/deploy.sh +++ b/infra/deploy.sh @@ -67,10 +67,12 @@ trap 'rm -rf "${temporary_dir}"' EXIT git archive --format=tar.gz --output="${temporary_dir}/tin-lite-release.tar.gz" HEAD # Each deploy uploads into its own private directory, so deploys by different people (or -# by CI) never collide on files another account left in /tmp. +# by CI) never collide on files another account left in /tmp. A first connection may print +# key-generation output, so only the directory line is kept. upload_dir="$(gcloud compute ssh "${instance}" \ --project "${TIN_LITE_GCP_PROJECT}" --zone "${zone}" --quiet \ - --command='mktemp -d /tmp/tin-deploy.XXXXXXXXXX' | tr -d '\r')" + --command='mktemp -d /tmp/tin-deploy.XXXXXXXXXX' | + tr -d '\r' | grep -E '^/tmp/tin-deploy\.[A-Za-z0-9]{10}$' | tail -n 1 || true)" if [[ ! "${upload_dir}" =~ ^/tmp/tin-deploy\.[A-Za-z0-9]{10}$ ]]; then echo "could not create a private upload directory on ${instance}" >&2 exit 70