diff --git a/AGENTS.md b/AGENTS.md index 8207e61..bde7a55 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -53,6 +53,7 @@ Known pre-existing errors (not yours, don't widen scope to fix them): `src/colle - If a dev server is **already running** when you want to test (port 3000 in use, or Next reports "Another next dev server is already running"), **ask the user whether you should kill the existing server and start a fresh one** before doing anything. A stale `.next/dev/devserver.lock` can also block startup — offer to clear it as part of the same question. - If the user says **no**, do **not** start a dev server and do **not** attempt to verify via E2E or Playwright — the user will run the app and test themselves, then report back. - Stale dev processes: killing the process is not always enough; remove `.next/dev/devserver.lock` before restarting. +- For browser/UI verification, make a reasonable attempt with Playwright. If the browser tooling is unavailable or repeatedly unreliable, stop rather than spending excessive effort on it and defer the manual UI check to the user. ## Agent debugging SOP (read before fixing any bug) @@ -292,7 +293,7 @@ shadcn/ui components live in `src/components/ui/`. Use `bunx shadcn@latest add < ## Deploy -`bun run deploy` bumps patch version (via `bun pm version patch`), builds, then runs `build/deploy.sh`. The `build/` directory is gitignored so the deploy script is not in the repo. +`bun run deploy` bumps the patch version (via `bun pm version patch`) and runs the production build. Push the resulting version commit to deploy through Coolify; the legacy `build/deploy.sh` path is no longer used. ## Gotchas diff --git a/DEPLOYMENT.md b/DEPLOYMENT.md index 37f6d3f..8e8166c 100644 --- a/DEPLOYMENT.md +++ b/DEPLOYMENT.md @@ -208,9 +208,15 @@ Recommended flow: 4. Coolify waits for `/api/health` to come back 200, then routes traffic. 5. If a new migration shipped with that deploy, run it via `docker exec` or a Scheduled Task (Sec. 7). -> **Version metadata in builds.** The image build embeds git info into `src/generated/versionInfo.json` (shown in the admin VersionOverlay and on `/api/version`). Coolify **deletes `.git`** from the build context, so the build reads the commit SHA from the `SOURCE_COMMIT` build arg instead of `git` (see the Dockerfile's `ARG SOURCE_COMMIT` block). For that to work, enable **"Include Source Commit in Build"** under the application's *Advanced* settings (and leave "Inject Build Args to Dockerfile" on, which is the default) — otherwise the version overlay falls back to `version` only. Tags, commit date, and commit subject have no Coolify equivalent and stay null on Coolify builds; local builds (`docker build`, `bun run dev`) still use real `git`. +> **Version metadata in builds.** The image build embeds git info into `src/generated/versionInfo.json` (shown in the admin VersionOverlay and on `/api/version`). Coolify **deletes `.git`** from the build context, so the build reads the commit SHA from the `SOURCE_COMMIT` build arg instead of `git` (see the Dockerfile's `ARG SOURCE_COMMIT` block). For that to work, enable **"Include Source Commit in Build"** under the application's *Advanced* settings (and leave "Inject Build Args to Dockerfile" on, which is the default) — otherwise the version overlay falls back to `version` only. +> +> **Commit metadata availability.** On Coolify builds, `SOURCE_COMMIT` is the commit SHA, but tags, dates, and subjects are not injected automatically. If the build environment provides `GIT_COMMIT_DATE` and `GIT_COMMIT_SUBJECT`, the generator records them as `lastUpdated` and `commitMessage`; otherwise `lastUpdated` falls back to the image build time and the commit message remains unavailable. The existing `canSeeCommit` permission still gates commit details in the overlay. +> +> Local builds (`docker build`, `bun run dev`) use real `git` and can populate all fields. -No SSH, no `rsync`, no `systemctl`. The legacy `build/deploy.sh` (gitignored, the old SSH+systemd flow to `jmf-usrv-2404`) is **no longer used** — exclude it from future deploys. `bun run deploy` (the npm script) will still try to run it (it calls `postversion → bash ./build/deploy.sh`); don't run it from your local machine anymore, or remove that script entry from `package.json` once you've moved onto Coolify for good. +> **Version bump ordering.** The `postversion` hook runs the production build after `package.json` has been bumped. This prevents the build from embedding the previous package version. + +No SSH, no `rsync`, no `systemctl`. The legacy `build/deploy.sh` (gitignored, the old SSH+systemd flow to `jmf-usrv-2404`) is **no longer used** — exclude it from future deploys. `bun run deploy` bumps the package version and runs the production build; push the resulting version commit to the branch watched by Coolify to deploy it. --- @@ -273,4 +279,4 @@ docker compose exec app sh # shell inside the app container --- -Last updated: 2026-08-12. Verify against the live repo if anything looks stale. \ No newline at end of file +Last updated: 2026-08-12. Verify against the live repo if anything looks stale. diff --git a/README.md b/README.md index 4758845..409f517 100644 --- a/README.md +++ b/README.md @@ -59,7 +59,7 @@ Dev credentials: `dev` / `Test123` (if seed data has been applied). | `bun run payload market-tick` | Expire listings and refresh NPC vendor stock | | `bun run payload mission-tick` | Auto-complete missions whose scheduled day has passed | | `bun run payload server-tick` | Mark game servers without a recent heartbeat offline | -| `bun run deploy` | Bump patch version, build, and deploy | +| `bun run deploy` | Bump patch version and build; push to deploy via Coolify | | `bun run version:bump -- --base --head ` | Choose and apply a patch/minor bump from a git range | Note: `game-tick` and `market-tick` are Payload bins registered in `payload.config.ts`, not npm scripts. Run via `bun run payload`.