fix: 调试发布run

This commit is contained in:
npc0-hue
2026-07-22 11:44:48 +08:00
parent b06623d0ce
commit 6c3eb6e45f
41 changed files with 1289 additions and 206 deletions
+10 -10
View File
@@ -6,7 +6,7 @@ This repository is the game server management platform workspace. It replaces th
- `platform_web/`: management console frontend.
- `plugins/`: game management plugin workspace. A plugin defines how to create and manage one server type, and one installed plugin can create many server instances.
The machine-side executor source lives in the separate `git@git.npc0.com:admin343/run.git` repository. Local debug and Docker workflows can keep it at `./run` as an ignored nested checkout, or use another path through `RUN_REPO_DIR`.
The machine-side executor source lives in the separate `git@git.npc0.com:admin343/run.git` repository. Local debug and Docker workflows can keep the editable source at `./run` as an ignored nested checkout, or use another path through `RUN_SOURCE_DIR` / legacy `RUN_REPO_DIR`. Local debug snapshots that source into `.local-debug` before building or starting run.
## Product Scope
@@ -69,7 +69,7 @@ Run focused checks when working in one root:
Run executor checks are owned by the separate run checkout:
```bash
(cd "${RUN_REPO_DIR:-./run}" && go test ./...)
(cd "${RUN_SOURCE_DIR:-${RUN_REPO_DIR:-./run}}" && go test ./...)
```
Run the API-backed local debug workspace when you need platform, run, platform_web, and the dev plugin fixture together:
@@ -83,12 +83,10 @@ scripts/local-debug-smoke.sh
See `docs/local-debug-workspace.md` for ports, disposable data roots, log files, reset steps, smoke evidence, and the required browser walkthrough. This workflow treats frontend local auth fallback as a verification failure.
Use `LOCAL_DEBUG_SELF_START=true scripts/local-debug-smoke.sh` when you need the smoke command to own the temporary local stack for the duration of the verification.
Start local processes:
For local debug, prefer the managed scripts because they snapshot run source into the closed `.local-debug` build bucket and start the bootstrap worker from the built binary:
```bash
(cd platform && go run ./cmd/platform)
(cd "${RUN_REPO_DIR:-./run}" && go run ./cmd/run)
(cd platform_web && npm run dev)
scripts/local-debug-start.sh
```
## Docker Deployment
@@ -156,9 +154,8 @@ Typical local debugging:
cp platform/.env.example platform/.env
cp platform_web/.env.example platform_web/.env
(cd platform && set -a && source .env && set +a && go run ./cmd/platform)
(cd "${RUN_REPO_DIR:-./run}" && go run ./cmd/run)
(cd platform_web && npm run dev)
scripts/local-debug-start.sh
scripts/local-debug-smoke.sh
```
Most common edits:
@@ -167,7 +164,10 @@ Most common edits:
- Platform file persistence: `PLATFORM_STORAGE_BACKEND=file`, `PLATFORM_METADATA_PATH`, `PLATFORM_LOG_DIR`.
- Platform MySQL metadata: `PLATFORM_STORAGE_BACKEND=mysql`, `PLATFORM_MYSQL_DSN=platform:platform@tcp(127.0.0.1:3306)/platform?parseTime=true`.
- Log body persistence: `PLATFORM_LOG_BODY_BACKEND=file`, `PLATFORM_LOG_DIR`.
- Run source checkout: `RUN_REPO_DIR=./run` by default; `run/` is ignored by the browser repository.
- Run editable source checkout: `RUN_SOURCE_DIR=./run` by default; legacy `RUN_REPO_DIR` is accepted as an alias; `run/` is ignored by the browser repository.
- Run closed build bucket: `RUN_BUILD_BUCKET_ROOT=.local-debug/run/build-buckets`.
- Run build source snapshot: `RUN_BUILD_SOURCE_ROOT=.local-debug/run/build-buckets/source/current`.
- Run bootstrap binary: `RUN_BOOTSTRAP_BIN=.local-debug/run/build-buckets/bootstrap/bin/run`.
- Run worker mode: `RUN_MODE=worker`.
- Run-to-platform URL: `RUN_PLATFORM_URL=http://127.0.0.1:8080` locally, `http://platform:8080` in Docker.
- Run local data: `RUN_WORKSPACE_ROOT`, `RUN_SPOOL_ROOT`.