Files
Commonwealth-Online-Server/server/scripts/linux_compat_checks.sh
T
andrew 881aa33eef
Linux Compatibility / Ubuntu dedicated server (push) Has been cancelled
Linux Compatibility / Arch Linux container (push) Has been cancelled
Harden Linux server runtime and packaging
Adds end-to-end Linux compatibility work for the dedicated server: new CI workflow (Ubuntu + Arch), line-ending/executable safeguards, and a local venv-first startup flow with split dependency files for server vs optional host GUI tooling. Improves runtime resilience with better bind error messages, stricter config validation, writable-state checks, cleaner socket/thread shutdown behavior, and SIGTERM-aware graceful stop handling for headless/systemd use. Updates deployment/startup docs and adds portability/runtime integration tests to lock in these behaviors.
2026-08-01 21:39:23 +12:00

41 lines
997 B
Bash

#!/usr/bin/env bash
set -Eeuo pipefail
ROOT="$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")/.." && pwd)"
cd -- "${ROOT}"
echo "==> Checking start.sh line endings (LF)"
python3 - <<'PY'
from pathlib import Path
data = Path("start.sh").read_bytes()
if b"\r\n" in data or data.count(b"\r"):
raise SystemExit("ERROR: start.sh contains CR/CRLF line endings")
PY
echo "==> Checking start.sh is executable"
test -x start.sh
echo "==> bash -n start.sh"
bash -n start.sh
if command -v shellcheck >/dev/null 2>&1; then
echo "==> shellcheck start.sh"
shellcheck start.sh
else
echo "WARNING: shellcheck not installed; skipping"
fi
echo "==> Creating clean virtual environment"
rm -rf .venv-ci
python3 -m venv .venv-ci
.venv-ci/bin/python -m pip install --upgrade pip
.venv-ci/bin/python -m pip install -r requirements-server.txt pytest
echo "==> compileall"
.venv-ci/bin/python -m compileall -q .
echo "==> pytest"
.venv-ci/bin/python -m pytest -q
echo "All Linux compatibility checks passed."