15 lines
1.1 KiB
Bash
Executable File
15 lines
1.1 KiB
Bash
Executable File
#!/bin/bash
|
|
# Läuft auf dem Entwicklungsrechner: kopiert das musl-Binary und die Testdateien nach srv04 und führt `prepare` aus.
|
|
# Startet nichts. Aufruf: scripts/srv04-leitstand-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; }
|
|
# Ein noch laufendes Testbinary blockiert scp: vorher beenden.
|
|
ssh "$HOST" 'bash /tmp/nexus-test-0126/remote.sh stop >/dev/null 2>&1 || true; mkdir -p /tmp/nexus-test-0126/bin'
|
|
scp -q "$BIN" "$HOST:/tmp/nexus-test-0126/bin/nexus"
|
|
scp -q "$HIER/remote.sh" "$HIER/fake_studio.py" "$HIER/nexus-test-studio.service.in" "$HIER/config.toml.in" "$HOST:/tmp/nexus-test-0126/"
|
|
ssh "$HOST" 'chmod +x /tmp/nexus-test-0126/bin/nexus /tmp/nexus-test-0126/remote.sh /tmp/nexus-test-0126/fake_studio.py; /tmp/nexus-test-0126/bin/nexus version; bash /tmp/nexus-test-0126/remote.sh prepare'
|
|
echo "Fertig. Starten: ssh $HOST 'bash /tmp/nexus-test-0126/remote.sh start'"
|