deploy_pr_demo
Deploy a throwaway, time-limited demo of an Application's pull-request build into an isolated ankra-demo-pr- namespace on the organisation's staging cluster. Every recorded component is deployed as its own Deployment + Service running the PR's container image tag: the entry component owns the preview host's root path and the others are routed under path prefixes on the same host (the application's saved demo routing when it declares one, else the frontend-shaped component at / and a single API-shaped sibling at /api). A public Ingress is rendered when the organisation has a demo domain configured or the staging cluster has an active DNS zone - the resolved public URL is returned as preview_url (empty when the demo stays in-cluster-only). The answer lists every deployed component under components[] with its image, container_port and ingress_path; the top-level image and service describe the entry component only. Environment variables merge over the Application's saved demo defaults; values may carry ${SECRET_SLOT:} sentinels (resolved server-side, mounted via a Kubernetes Secret) and, when the database is enabled, ${{ ankra.demo_database.url|host|port|name|user|password }} placeholders resolving to a throwaway per-demo Postgres. Safe in ask mode: the demo is isolated in its own namespace and the reaper deletes it at TTL, so it cannot affect existing deployments. Requires a configured staging cluster, application_id, pr_number, and image_tag (the tag the PR build pushed).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| env | No | Extra environment variables for the demo container as a name-to-value object. Values may carry ${SECRET_SLOT:<uuid>} sentinels (treated as secret and mounted via a Kubernetes Secret) and, when database is enabled, ${{ ankra.demo_database.* }} placeholders. Merged over the Application's saved demo env defaults; these win by name. | |
| database | No | Provision a throwaway Postgres (random per-demo password, deleted with the demo) inside the demo namespace and enable the ${{ ankra.demo_database.* }} placeholders. Overrides the Application's saved default. | |
| image_tag | Yes | The container image tag the PR head build pushed (appended to the Application's container image URL). | |
| pr_number | Yes | The pull-request number; names and isolates the demo namespace. | |
| application_id | Yes | The Application to deploy a PR demo of. | |
| container_port | No | The port the entry component's container listens on (defaults to that component's Dockerfile EXPOSE port, or 8080 when none is declared). | |
| entry_component | No | The component that owns the preview host's root path on a multi-component application; the other components keep their path prefixes. Omit to use the application's saved demo routing, then the heuristic (frontend-shaped component, else the primary one). A name that is not a recorded component is refused. |