stuntman / environments

One Stuntman. An environment per branch.

Each environment has its own plugins, state, rules, inboxes, base URLs and MCP endpoint. Pause it and the state is kept; clone it for a pull request and let it expire.

Environments: STG-A, STG-B (paused), STG-C and pr-5451, cloned by a pipeline, expiring in 22 h

The life of pr-5462.

  1. Cloned from stg-aservices, rules, inboxes and seeds; no traffic history
  2. The pipeline points the appprovider URLs at *.pr-5462.stuntman.local
  3. An agent tests the branchover /e/pr-5462/mcp
  4. Paused for reviewcalls answer 503; the state is kept
  5. Expires by itselfdeleted, state and all
curl -X POST localhost:8025/api/environments \
  -H "content-type: application/json" \
  -d '{"name": "pr-5462", "from": "stg-a", "expires": "24h"}'

A request finds its environment.

A request that matches none of these goes to the default environment.

By host name

otp.pr-5462.stuntman.local

By path prefix

localhost:8025/e/pr-5462/mcp

By gRPC metadata

x-stuntman-env: pr-5462

One server for every branch.

Make each environment from a template with its values, share one SMTP port, hand the app its settings by name, and give people one public address where each environment lives under /e/<name>/.

From a template

{"name": "pr-5462", "from": "acme-preview",
 "vars": {"domain": "preview.acme.example"}}

One public address

STUNTMAN_PUBLIC_URL=https://stuntman.example.com
/e/pr-5462/        screens
/e/pr-5462/mcp     MCP
/e/pr-5462/login/  sign-in pages

What the app sets

GET /api/environments/pr-5462/connections
SMTP_USER=pr-5462
IDENTITY_AUTHORITY=https://…/e/pr-5462/…

Clone, start empty or start from files.

Pick what comes along: services and their files, rules, inboxes, secrets and, optionally, the state. Set how long it lives and where its callbacks go.

New environment: a copy, empty or from files