Complete C# server cutover
This commit is contained in:
Regular → Executable
+32
-29
@@ -4,37 +4,40 @@ 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"
|
||||
echo "==> Rejecting Python source/runtime dependencies"
|
||||
if find .. -type f -name '*.py' -print -quit | grep -q .; then
|
||||
find .. -type f -name '*.py' -print
|
||||
echo "ERROR: Python source files are not allowed in CO-SERVER." >&2
|
||||
exit 1
|
||||
fi
|
||||
if find . -maxdepth 1 -type f -name 'requirements*.txt' -print -quit | grep -q .; then
|
||||
find . -maxdepth 1 -type f -name 'requirements*.txt' -print
|
||||
echo "ERROR: Python requirements files are not allowed." >&2
|
||||
exit 1
|
||||
fi
|
||||
if grep -RInE --exclude-dir=.git --exclude='*.md' --exclude='PORT_TROUBLESHOOTING.txt' '(python3?|\.venv|pip install|consumer_server_cli\.py)' ..; then
|
||||
echo "ERROR: Python runtime references remain in executable/configuration files." >&2
|
||||
exit 1
|
||||
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 "==> Checking start.sh line endings"
|
||||
if LC_ALL=C grep -n $'\r' start.sh >/dev/null 2>&1; then
|
||||
echo "ERROR: start.sh contains CR/CRLF line endings" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "==> compileall"
|
||||
.venv-ci/bin/python -m compileall -q .
|
||||
chmod +x start.sh fix-port.sh
|
||||
test -x start.sh
|
||||
bash -n start.sh
|
||||
bash -n fix-port.sh
|
||||
|
||||
echo "==> pytest"
|
||||
.venv-ci/bin/python -m pytest -q
|
||||
if command -v shellcheck >/dev/null 2>&1; then
|
||||
shellcheck start.sh fix-port.sh
|
||||
fi
|
||||
|
||||
echo "All Linux compatibility checks passed."
|
||||
command -v dotnet >/dev/null 2>&1 || { echo "ERROR: dotnet SDK is required" >&2; exit 1; }
|
||||
dotnet --info
|
||||
dotnet build CommonwealthOnline.Server.csproj -c Release --nologo
|
||||
dotnet run --project tests/CommonwealthOnline.Server.Tests.csproj -c Release --no-restore
|
||||
|
||||
echo "All C# Linux compatibility checks passed."
|
||||
|
||||
Reference in New Issue
Block a user