Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions .cursor/environment.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"name": "build_tracker",
"user": "ubuntu",
"install": "bash scripts/cloud-install.sh",
"terminals": [
{
"name": "web",
"command": "source .venv/bin/activate && uvicorn app.main:app --host 0.0.0.0 --port 8000",
"description": "FastAPI + static UI (Build Tracker) on http://localhost:8000"
}
],
"ports": [
{
"name": "web server",
"port": 8000
}
]
}
37 changes: 37 additions & 0 deletions scripts/cloud-install.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
#!/usr/bin/env bash
# Idempotent Cloud Agent install: prepares a Python virtualenv with the
# project dependencies. Safe to run repeatedly.
set -euo pipefail

cd "$(dirname "$0")/.."

# Ubuntu ships the venv module in a separate package; install it once if missing.
if ! python3 -c "import ensurepip" >/dev/null 2>&1; then
sudo apt-get update -qq
sudo apt-get install -y -qq python3-venv python3-pip
fi

# Create the virtualenv once, then reuse it on later runs.
if [ ! -x .venv/bin/python ]; then
python3 -m venv .venv
fi

# shellcheck disable=SC1091
source .venv/bin/activate

python -m pip install --upgrade pip
pip install -r requirements.txt

# Warm the Data Dragon static-data cache (items/champions) so the app has data
# to render even before a Riot sync. Non-fatal if the network is unavailable.
python - <<'PY'
try:
from app.ddragon import DataDragon

DataDragon()
print("Data Dragon cache warmed")
except Exception as exc: # pragma: no cover - best effort
print(f"Data Dragon warm skipped: {exc}")
PY

echo "cloud-install: done"