pruefen: auch ausserhalb eines Git-Checkouts; probelauf-box.sh prueft HEAD auf der Box
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5.5
parent
b1bc9395cf
commit
1389b46846
@@ -0,0 +1,19 @@
|
||||
#!/usr/bin/env bash
|
||||
# probelauf-box.sh — das Prüftor mit dem lokalen Stand (HEAD) auf der KI-Box laufen lassen, bevor
|
||||
# etwas nach main geht. Der PC ist Windows, die Box Linux: Wettläufe und Pfadfragen zeigen sich
|
||||
# oft erst dort (24.09.2026: ein Test war am PC grün und auf der Box rot, der Deploy rollte zurück).
|
||||
#
|
||||
# Nutzung (Git-Bash am PC, im Repo): bash deploy/probelauf-box.sh
|
||||
# Braucht SSH-Zugang zur Box (MC_BOX, Standard hitonabi@192.168.178.151). Ändert auf der Box nichts
|
||||
# außer einem Wegwerf-Ordner unter /tmp; benutzt das Python des Box-Checkouts.
|
||||
set -euo pipefail
|
||||
cd "$(dirname "$0")/.."
|
||||
BOX="${MC_BOX:-hitonabi@192.168.178.151}"
|
||||
ORDNER="/tmp/mc2-probelauf-$$"
|
||||
|
||||
echo "Probelauf von $(git rev-parse --short HEAD) auf $BOX …"
|
||||
git archive --format=tar HEAD backend deploy ruff.toml \
|
||||
| ssh -o BatchMode=yes "$BOX" "rm -rf $ORDNER && mkdir -p $ORDNER && tar -x -C $ORDNER"
|
||||
# shellcheck disable=SC2029 # $ORDNER soll hier (am PC) eingesetzt werden
|
||||
ssh -o BatchMode=yes "$BOX" "cd $ORDNER && MC_PRUEF_PYTHON=\$HOME/mission-control-v2/backend/.venv/bin/python \
|
||||
bash deploy/pruefen.sh; code=\$?; rm -rf $ORDNER; exit \$code"
|
||||
@@ -25,7 +25,13 @@ for f in deploy/*.sh deploy/jobs/*.sh; do
|
||||
done
|
||||
|
||||
schritt "Python-Syntax"
|
||||
# Außerhalb eines Git-Checkouts (Probelauf eines Abzugs auf der Box) alle .py-Dateien nehmen.
|
||||
if git rev-parse --is-inside-work-tree >/dev/null 2>&1; then
|
||||
git ls-files '*.py' | grep -v '^frontend/' | xargs "$PY" -m py_compile || fehler=1
|
||||
else
|
||||
find . -name '*.py' -not -path './frontend/*' -not -path '*/.venv/*' -not -path '*/node_modules/*' -print0 \
|
||||
| xargs -0 "$PY" -m py_compile || fehler=1
|
||||
fi
|
||||
|
||||
schritt "Lint (ruff)"
|
||||
if command -v ruff >/dev/null 2>&1; then
|
||||
|
||||
Reference in New Issue
Block a user