installers: move to project root, share a single .venv
client/install.sh → install_client.sh server/install.sh → install_server.sh Both scripts now resolve REPO_DIR as their own directory (repo root) and use a shared .venv at the repo root instead of per-subdirectory virtual environments. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -1,20 +1,20 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
# CLIENT installer — sets up the we_monitor GUI client.
|
# CLIENT installer — sets up the we_monitor GUI client.
|
||||||
# Does NOT install the server (see server/install.sh).
|
# Does NOT install the server (see install_server.sh).
|
||||||
#
|
#
|
||||||
# Fresh install:
|
# Fresh install:
|
||||||
# chmod +x install.sh
|
# chmod +x install_client.sh
|
||||||
# ./install.sh
|
# ./install_client.sh
|
||||||
#
|
#
|
||||||
# Update (code already pulled via git):
|
# Update (code already pulled via git):
|
||||||
# ./install.sh
|
# ./install_client.sh
|
||||||
|
|
||||||
set -euo pipefail
|
set -euo pipefail
|
||||||
|
|
||||||
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
||||||
REPO_DIR="$(dirname "$SCRIPT_DIR")"
|
REPO_DIR="$SCRIPT_DIR"
|
||||||
|
|
||||||
VENV="$SCRIPT_DIR/.venv"
|
VENV="$REPO_DIR/.venv"
|
||||||
PYTHON="$VENV/bin/python"
|
PYTHON="$VENV/bin/python"
|
||||||
|
|
||||||
IS_UPDATE=false
|
IS_UPDATE=false
|
||||||
@@ -41,15 +41,15 @@ fi
|
|||||||
|
|
||||||
echo "==> Installing / updating dependencies"
|
echo "==> Installing / updating dependencies"
|
||||||
"$VENV/bin/pip" install --quiet --upgrade pip
|
"$VENV/bin/pip" install --quiet --upgrade pip
|
||||||
"$VENV/bin/pip" install --quiet --upgrade -r "$SCRIPT_DIR/requirements.txt"
|
"$VENV/bin/pip" install --quiet --upgrade -r "$REPO_DIR/client/requirements.txt"
|
||||||
echo " Python : $PYTHON"
|
echo " Python : $PYTHON"
|
||||||
echo ""
|
echo ""
|
||||||
|
|
||||||
# ── 2. launcher script ────────────────────────────────────────────────────────
|
# ── 2. launcher script ────────────────────────────────────────────────────────
|
||||||
LAUNCHER="$SCRIPT_DIR/run.sh"
|
LAUNCHER="$REPO_DIR/client/run.sh"
|
||||||
cat > "$LAUNCHER" <<EOF
|
cat > "$LAUNCHER" <<EOF
|
||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
exec "$PYTHON" "$SCRIPT_DIR/gui_client.py" "\$@"
|
exec "$PYTHON" "$REPO_DIR/client/gui_client.py" "\$@"
|
||||||
EOF
|
EOF
|
||||||
chmod +x "$LAUNCHER"
|
chmod +x "$LAUNCHER"
|
||||||
echo "==> Launcher written : $LAUNCHER"
|
echo "==> Launcher written : $LAUNCHER"
|
||||||
@@ -60,7 +60,7 @@ CMD="$BIN_DIR/we_monitor_gui"
|
|||||||
mkdir -p "$BIN_DIR"
|
mkdir -p "$BIN_DIR"
|
||||||
cat > "$CMD" <<EOF
|
cat > "$CMD" <<EOF
|
||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
exec "$PYTHON" "$SCRIPT_DIR/gui_client.py" "\$@"
|
exec "$PYTHON" "$REPO_DIR/client/gui_client.py" "\$@"
|
||||||
EOF
|
EOF
|
||||||
chmod +x "$CMD"
|
chmod +x "$CMD"
|
||||||
echo "==> System command : $CMD"
|
echo "==> System command : $CMD"
|
||||||
@@ -15,7 +15,7 @@
|
|||||||
set -euo pipefail
|
set -euo pipefail
|
||||||
|
|
||||||
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
||||||
REPO_DIR="$(dirname "$SCRIPT_DIR")"
|
REPO_DIR="$SCRIPT_DIR"
|
||||||
SERVICE_NAME="we_monitor"
|
SERVICE_NAME="we_monitor"
|
||||||
CREDS_DIR="$HOME/.config/we_monitor"
|
CREDS_DIR="$HOME/.config/we_monitor"
|
||||||
CREDS_FILE="$CREDS_DIR/credentials.json"
|
CREDS_FILE="$CREDS_DIR/credentials.json"
|
||||||
@@ -23,7 +23,7 @@ SYSTEMD_DIR="$HOME/.config/systemd/user"
|
|||||||
SERVICE_FILE="$SYSTEMD_DIR/$SERVICE_NAME.service"
|
SERVICE_FILE="$SYSTEMD_DIR/$SERVICE_NAME.service"
|
||||||
LOG_DIR="$REPO_DIR/logs"
|
LOG_DIR="$REPO_DIR/logs"
|
||||||
|
|
||||||
VENV="$SCRIPT_DIR/.venv"
|
VENV="$REPO_DIR/.venv"
|
||||||
PYTHON="$VENV/bin/python"
|
PYTHON="$VENV/bin/python"
|
||||||
|
|
||||||
# detect fresh install vs update
|
# detect fresh install vs update
|
||||||
@@ -55,7 +55,7 @@ fi
|
|||||||
|
|
||||||
echo "==> Installing / updating dependencies"
|
echo "==> Installing / updating dependencies"
|
||||||
"$VENV/bin/pip" install --quiet --upgrade pip
|
"$VENV/bin/pip" install --quiet --upgrade pip
|
||||||
"$VENV/bin/pip" install --quiet --upgrade -r "$SCRIPT_DIR/requirements.txt"
|
"$VENV/bin/pip" install --quiet --upgrade -r "$REPO_DIR/server/requirements.txt"
|
||||||
|
|
||||||
echo "==> Applying cariad-hybrid-auth-fix.patch to volkswagencarnet"
|
echo "==> Applying cariad-hybrid-auth-fix.patch to volkswagencarnet"
|
||||||
SITE_PKG="$("$PYTHON" -c 'import sysconfig; print(sysconfig.get_path("purelib"))')"
|
SITE_PKG="$("$PYTHON" -c 'import sysconfig; print(sysconfig.get_path("purelib"))')"
|
||||||
Reference in New Issue
Block a user