@mayurajs/deploy-render
v1.2.0
Published
Render as a mayura deploy target: a Blueprint with a web service, a background worker and PostgreSQL.
Downloads
197
Readme
@mayurajs/deploy-render
Render as a mayura deploy target: a Blueprint with the server as a web service, a background
worker and PostgreSQL, released with the Render CLI.
npm install --save-dev @mayurajs/deploy-render
mayura deploy init --target render --apply # writes render.yaml and deploy/render/Dockerfile; commit and push them
# Once: in the dashboard, New > Blueprint from the repository, and enter the secrets it asks for. Then set
# targets.render.serverServiceId and workerServiceId (srv-…) in mayura.deploy.json.
mayura deploy --target render # prints the plan and its digest
mayura deploy --target render --apply --confirm <digest>render.yamldescribes:- a web service (
serve, with a/readyzhealth check); - a background worker;
- a PostgreSQL database, given to both as
DATABASE_URL.
- a web service (
- Both services build from
deploy/render/Dockerfile, an image without an entry point, so their full start and pre-deploy commands run as written. - Both services migrate storage before they go live. Migrations take a lock, so whichever runs first does the work, and a failed migration fails the deploy.
- Each variable named in
envinmayura.deploy.jsonis declared withsync: false. Render asks for its value when you create the Blueprint, so values never reach the repository. - Render deploys from your repository, so push before releasing.
- A release:
- validates the Blueprint with
render blueprints validate; - runs
render deploys create <id> --waitfor the server, then the worker, stopping at the first failure.
- validates the Blueprint with
autoDeployisoffby default, so releases go throughmayura deploy. SetcommitorchecksPassto let Render deploy on its own.- Settings in
mayura.deploy.jsonundertargets.render:region(oregon),plan(starter; pre-deploy commands need a paid instance type) anddatabasePlan(basic-256mb);autoDeploy;serverServiceIdandworkerServiceId.
- The Render CLI uses its own login (
render login), orRENDER_API_KEYin CI. Mayura reads neither.
See Deploy with mayura deploy. Apache-2.0.
