Skip to content
Docs/Guides

Deployments and environments

Every product in your factory ships through environments. An environment is one running copy of your product — a preview, a staging site, production — with its own version, its own hostname, its own deploy rules and its own history.

This page covers where products deploy to, what starts a deploy, and what you can see and undo afterwards.

Your factory has a default deploy target, set in Settings → Deployment. A product can override it, and a single environment can override the product:

factory default → product → environment

Pick a mode first, because it decides everything else:

ModeWhat happens
GitOpsYour repository owns the deploy. Sapient writes and maintains the CI workflow; your own pipeline ships on merge, wherever it already ships to. There is no target for us to choose, so the provider grid is switched off.
ManagedSapient deploys directly through the provider’s API after the deploy gate. Choose the provider below.

Managed targets: Vercel, Netlify, Cloudflare, Cloud Run, AWS, and Sapient Deploy — Sapient’s own hosting, which needs no account at all. Connect them under Settings → Connectors — see the connectors overview.

Project name, build command and output directory are detected from the product’s repository the first time it deploys. Set them on the environment only if the detected values are wrong.

Each environment has a trigger, set on its own page:

TriggerMeaningStatus today
Manual onlyNothing ships until someone presses Deploy now or signs the pipeline’s per-story deploy approval.Active
When a sprint completesStories finish and merge without deploying. When the sprint’s last story lands, one release approval opens; signing it ships the whole sprint in a single production deploy.Active
On every pull requestA throwaway copy per open PR, torn down when it merges.Recorded, not yet running
Promote from another environmentFollows an upstream deploy after a soak you set.Recorded, not yet running

With the production trigger set to When a sprint completes, no story ships on its own — each one finishes, merges, and rests as done. The moment the sprint’s last story lands, one approval appears in your inbox naming the sprint and every story in it. Signing it runs a single production deploy that contains all of them, and only then do the stories read deployed.

Three honesty rules apply:

  • An unmerged story blocks the release. If a story is finished but its pull request is still open, the build would not contain it — so the release approval will not open, and an incident tells you which pull requests to merge (or which stories to cancel).
  • Rejecting the release keeps everything parked at done. Nothing ships, and you are not asked again for the same set of stories. A story completed later reopens a fresh release approval covering everything still waiting.
  • Stories without a sprint keep the per-story approval. There is no release to batch them with.

Deploys are governed by your approval and spend policy, and there are two paths:

  • The engineering pipeline opens an approval for you to sign — per story under a manual trigger, or one per release under a sprint trigger. Nothing ships until you do.
  • Deploy now, on an environment page, asks to deploy immediately. If your policy allows it, it runs. If it does not, it is refused and tells you why — it is not queued behind your back.

Settings → Deployment → Production release policy records how you want releases handled: whether they should go automatically once staging has held healthy, how long that soak should be, who signs when it is off, and whether a bad-health reading should roll a release back.

Open an environment from the product page, from Settings → Deployment, or from the engineering release pipeline.

  • Header — health, hostname, running version, when it last deployed, and Deploy now, Roll back and Logs & traces.
  • How this environment gets deployed — the trigger, the branch it deploys, and (for a promoted environment) the source, the soak, whether every story must have passed verification, and whether a health breach upstream should cancel the promotion.
  • Deploy setup — target, mode, project, branch, where it serves, and your custom domain.
  • Secrets — the variable names this environment injects and where each is stored. Values are never stored in Sapient and are never shown anywhere in the app; only an owner or maintainer can see even the names.
  • Delivery metrics — deploy frequency, change failure rate and time to restore over 24 hours, 7 days or 30 days.
  • Deploy history — every deploy into this environment, what started it, and whether it stuck.

Lead time currently always shows a dash: it is the time from merge to deploy, and merge timestamps are not recorded on pull requests yet.

Roll back restores the deploy that previously served an environment. You can also restore a specific earlier deploy from the history list.

A rollback is gated exactly like a deploy — rolling production back is as consequential as shipping to it, so it opens the same approval. It is recorded as its own entry in the history rather than quietly resurrecting an old one.

Some providers cannot roll back through their API. When that is the case Sapient says so and asks you to redeploy the previous version instead.

Settings → Deployment → Environment ladder is the set of environments you want a new product to start with — typically Preview, Staging and Production, each with its branch and trigger.

It is a template. Editing the ladder never changes the environments a product already has; add or remove those on the product itself.

On a product page, use Add an environment. Name it (canary, demo, EU — anything), optionally copy the deploy setup from an existing environment, and choose how it gets deployed.

Copying deploy setup copies the target and branch. It does not copy secrets: those are written through the connector that owns them, so they are attached per environment rather than duplicated.

A new environment starts empty, with no metrics and no history, until something ships to it.