From ac8a3f012c7b836268af15a4b7f38a5234d3d4df Mon Sep 17 00:00:00 2001 From: Assistant builder Date: Fri, 12 Jun 2026 19:16:32 +0000 Subject: [PATCH] Test 4a: bin/probe-cs-4a deploy script with ~/.openai_key precondition --- bin/probe-cs-4a | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 bin/probe-cs-4a diff --git a/bin/probe-cs-4a b/bin/probe-cs-4a new file mode 100644 index 0000000..4b7cf8a --- /dev/null +++ b/bin/probe-cs-4a @@ -0,0 +1,36 @@ +#!/usr/bin/env bash +set -euo pipefail + +PI_HOST="${PI_HOST:-192.168.50.115}" +PI_USER="${PI_USER:-pi}" +PI_PASS="${PI_PASS:-assistant}" +PUBLISH_DIR="${PUBLISH_DIR:-/tmp/probe-cs-4a-out}" + +repo_root="$(cd "$(dirname "$0")/.." && pwd)" +cd "$repo_root" + +echo ">> precondition: ~/.openai_key present on Pi" +if ! sshpass -p "$PI_PASS" ssh -o StrictHostKeyChecking=accept-new \ + "$PI_USER@$PI_HOST" 'test -f ~/.openai_key && test -r ~/.openai_key'; then + echo "ERROR: ~/.openai_key missing or unreadable on Pi." + echo "Create it on the Pi with:" + echo " sshpass -p '$PI_PASS' ssh $PI_USER@$PI_HOST \\" + echo " 'umask 077 && printf \"%s\\n\" \"sk-PASTE-YOUR-KEY\" > ~/.openai_key'" + exit 1 +fi +echo " OK." + +echo ">> dotnet publish (linux-arm64, self-contained)" +dotnet publish tests/04a-realtime-oneshot-cs \ + -c Release -r linux-arm64 --self-contained \ + -o "$PUBLISH_DIR" + +echo ">> scp to $PI_USER@$PI_HOST:~/probe-cs-4a/ (wipe-and-replace)" +sshpass -p "$PI_PASS" ssh -o StrictHostKeyChecking=accept-new \ + "$PI_USER@$PI_HOST" 'rm -rf ~/probe-cs-4a && mkdir ~/probe-cs-4a' +sshpass -p "$PI_PASS" scp -r "$PUBLISH_DIR/." \ + "$PI_USER@$PI_HOST:~/probe-cs-4a/" + +echo ">> ssh + run on Pi (Ctrl-C from this terminal stops the probe)" +sshpass -p "$PI_PASS" ssh -t -o StrictHostKeyChecking=accept-new \ + "$PI_USER@$PI_HOST" 'cd ~/probe-cs-4a && chmod +x Probe && ./Probe'