fix(cloud): ensure DATABASE_URL before pnpm install on Cloud agents#140
Closed
mkayander wants to merge 1 commit into
Closed
fix(cloud): ensure DATABASE_URL before pnpm install on Cloud agents#140mkayander wants to merge 1 commit into
mkayander wants to merge 1 commit into
Conversation
- Add .cursor/environment.json and cloud-agent-update.sh install script - Seed .env from cloud-agent.env.template when missing - Fall back to local PostgreSQL URL in prisma.config.ts for prisma generate - Align .env.example with PostgreSQL and document install flow in AGENTS.md
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Cloud agent
pnpm installfailed during postinstall because Prisma could not resolveDATABASE_URL:The update flow started PostgreSQL and ran
pnpm installbefore a.envfile existed.Solution
.cursor/environment.json— pointsinstallatbash .cursor/cloud-agent-update.shand starts PostgreSQL on machine boot..cursor/cloud-agent-update.sh— idempotent update script: start Postgres → ensure.envfrom template →pnpm install→pnpm prisma:push..cursor/cloud-agent.env.template— committed local-dev defaults (PostgreSQL URL,SKIP_ENV_VALIDATION, placeholder OAuth/AWS keys).prisma.config.ts— fallback topostgresql://dstruct:dstruct@localhost:5432/dstructwhen env vars are unset soprisma generatesucceeds during postinstall even without.env..env.example/AGENTS.md— aligned docs and example with PostgreSQL + install flow.Verification
Ran
bash .cursor/cloud-agent-update.shon a clean VM (no.env): postinstall, Prisma generate, GraphQL codegen, andprisma db pushall succeeded.Dashboard note
If a saved Cloud environment still uses a custom update command (e.g. bare
pnpm install), either switch to repo.cursor/environment.jsonor ensure.envexists before install.