Plan — Update TASKS_DIRECTORY for viewer (#10)#
Summary#
Add a pm2 ecosystem config file with TASKS_DIRECTORY=/home/agent/AgentSDE/tasks/production so the VPS deployment reads artefacts from the centralized path introduced by agent-core PR #224. Update .env.example to document the production value.
Files#
| File | Action | Description |
|---|---|---|
ecosystem.config.js | create | pm2 ecosystem config with production env vars including correct TASKS_DIRECTORY |
.env.example | modify | Add comment documenting the production TASKS_DIRECTORY path |
Steps#
- Create
ecosystem.config.jsat repo root with app nameviewerv2-backend, scriptdist/main, andTASKS_DIRECTORY=/home/agent/AgentSDE/tasks/productioninenv_production. Include existing env vars from.env.example(PORT, NODE_ENV, HOST) with production defaults. - Update
.env.exampleto add a comment aboveTASKS_DIRECTORYnoting the production value (/home/agent/AgentSDE/tasks/production). - Run
npm run lintandnpm run testto verify no regressions.
Verification#
ecosystem.config.jsexports a valid pm2 config withTASKS_DIRECTORY=/home/agent/AgentSDE/tasks/production.env.exampledocuments the production path- Lint and tests pass with no regressions
Risks#
- pm2 on VPS must be restarted with
pm2 start ecosystem.config.js --env productionafter deploy for the new config to take effect — this is an operational step outside the PR scope.