From 7540329002478656d3ce1ef72013bd6eb336c5a2 Mon Sep 17 00:00:00 2001 From: Cursor Agent Date: Sun, 30 Aug 2026 13:02:33 +0000 Subject: [PATCH] Add Cloud Agent dev environment config and install script Co-authored-by: Javiops --- .cursor/environment.json | 18 ++++++++++++++++++ scripts/cloud-install.sh | 37 +++++++++++++++++++++++++++++++++++++ 2 files changed, 55 insertions(+) create mode 100644 .cursor/environment.json create mode 100755 scripts/cloud-install.sh diff --git a/.cursor/environment.json b/.cursor/environment.json new file mode 100644 index 0000000..482420e --- /dev/null +++ b/.cursor/environment.json @@ -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 + } + ] +} diff --git a/scripts/cloud-install.sh b/scripts/cloud-install.sh new file mode 100755 index 0000000..7d59c9f --- /dev/null +++ b/scripts/cloud-install.sh @@ -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"