#!/bin/bash # Läuft auf dem Entwicklungsrechner: kopiert das musl-Binary und die Testdateien nach srv04 und führt `prepare` aus. # Startet nichts und lädt kein Modell. Aufruf: scripts/srv04-engineui-test/deploy.sh (HOST überschreibbar, Standard 192.168.12.4) set -eu HOST="${HOST:-192.168.12.4}" HIER="$(cd "$(dirname "$0")" && pwd)" BIN="$HIER/../../target/x86_64-unknown-linux-musl/release/nexus" [ -x "$BIN" ] || { echo "Binary fehlt: $BIN (cargo build --release --target x86_64-unknown-linux-musl -p nexus)"; exit 1; } ssh "$HOST" 'bash /tmp/nexus-test-0129/remote.sh stop >/dev/null 2>&1 || true; for i in 1 2 3 4 5 6 7 8 9 10; do ps -eo args | grep -q "^/tmp/nexus-test-0129/bin/nexus serve" || break; sleep 1; done; mkdir -p /tmp/nexus-test-0129/bin' scp -q "$BIN" "$HOST:/tmp/nexus-test-0129/bin/nexus" scp -q "$HIER/remote.sh" "$HIER/config.toml.in" "$HOST:/tmp/nexus-test-0129/" ssh "$HOST" 'chmod +x /tmp/nexus-test-0129/bin/nexus /tmp/nexus-test-0129/remote.sh; /tmp/nexus-test-0129/bin/nexus version; bash /tmp/nexus-test-0129/remote.sh prepare' echo "Fertig. Starten: ssh $HOST 'bash /tmp/nexus-test-0129/remote.sh start'"