Delivery manifest schema reference
The authoritative, machine-readable shape of ci/<name>/delivery.yml is
docs/delivery.schema.json — a JSON Schema kept
in sync with manifest/parser.ts. Point your editor's YAML language server at
it for inline validation and completion:
# yaml-language-server: $schema=../../docs/delivery.schema.json
version: v1
This repo's own manifests do exactly this: ci/website/delivery.yml points at
it with that relative path, ci/cli/delivery.yml with the absolute
raw.githubusercontent.com URL instead — either form works, an absolute URL is
just resilient to the file being opened from a different working directory.
This page is a reading guide to that schema, not a restatement of it — see Delivery manifests for the narrative version of the same model.
Top level
version— always"v1"today.release— map of ship name →{ kit, mode?, outputName?, publish? }.deploy— map of category → map of resource name → a category-specific shape (see below).operations— map of operation name →{ run | script, arguments? }, commands the workload declares for a human or a CI job to invoke (see below).launch— map of name → a program or desktop appens developstarts on this machine:{ type: process | desktop, command | package, ports?, env?, envSecrets?, development? }.ens deployignores it. See Launching.
Fully-typed resource shapes
Five resource kinds have a dedicated schema definition, matching a seeded
ResourceContract:
| Schema definition | Category | type |
Required fields | Declared outputs |
|---|---|---|---|---|
containerResource |
compute |
container |
image, replicas |
(none listed — see note below) |
storageVolumeResource |
storage |
volume |
(none beyond type) |
name |
objectStorageResource |
storage |
object-storage |
bucket |
url, bucket |
relationalResource |
databases |
relational |
engine, version, user, database, passwordSecret |
host, port, user, database, url |
gatewayResource |
networking |
gateway |
routes (optional networks) |
(none — nothing references ${networking.*} yet) |
A container compute's ports map is itself the reference surface for its
ports (${compute.<name>.<port-name>}) rather than a separate outputs list.
The name is yours to choose — nothing reads meaning into it — and each value is
the port the container listens on, never a host binding: compose never
publishes it to the host's own port space, so several computes declaring the
same container port is fine — they only ever share the compose network, where
anything that needs a compute reaches it as <service>:<port>, the same address
a compute's own ${compute.*} references and the gateway's routes resolve to.
From the host itself, docker compose exec <service> ... reaches a compute
directly, and on native Linux Docker so does its container IP
(docker network inspect finds it) — neither needs a published port, and Docker
Desktop's own VM-based networking can't reach either without one, so this
manifest field never tries to bridge that gap.
A compute's address is a host and a port: ${compute.<name>.host} and
${compute.<name>.<port-name>}, written together as
http://${compute.judge.host}:${compute.judge.http}. The host is the name
another compute on a network they share reaches it by, and what that name is
belongs to the deploy kit: on compose it is the container's name,
<deployment>-<name>-1, which no other deployment on a shared network can
answer for; a kit with no such name for a compute (aws has none yet) fails the
render of any manifest that references it, saying so. Neither the host nor a
port waits on the compute being rendered, so computes may name each other, as a
guard and the service it fronts do, and naming one's address is no reason for
ens to bring the other up first (depends_on). Anything that does need
another resource up first, such as a volume or a database, is still ordered by
its reference.
relationalResource also accepts an optional init — a list of repo-relative
SQL/shell file paths run against a fresh database on startup. compose mounts
each one read-only into postgres's own docker-entrypoint-initdb.d, in filename
order; aws drops it silently, same as ports/networks elsewhere, since an
already-provisioned RDS instance has no equivalent hook.
objectStorageResource also accepts optional accessKeySecret/
secretKeySecret — names of secrets entries supplying static S3 credentials.
compose (Garage) requires both, since Garage has no other way to get static
credentials — and in Garage's own format, which it validates when it imports the
pair after the bucket's container comes up: the access key is GK followed by
24 hex characters, the secret key 64 hex characters. aws (a plain
AWS::S3::Bucket) drops both silently, since IAM always mints its own access
keys rather than importing a caller-chosen pair — a manifest targeting aws only
can omit them.
gatewayResource is implemented only on compose (Caddy) today — declaring one
targeting aws has no provisioner to satisfy it, the same kind of deliberate gap
storage.volume had before it had a second target. Its routes array is
shallow at the schema level (each entry's real shape,
{ host, path, target: { service, port } }, is documented but not deeply
validated): path is either a plain prefix string (the full request URI is
forwarded unchanged) or { match, strip: true } to strip the matched prefix
before forwarding; target.service names the compute to route to as a plain
string, and target.port is usually ${compute.<name>.<port>} — split apart
rather than one combined reference, since a compute-port reference alone always
bakes to a bare number, never the compute's own name. A gateway
declares no TLS: who ends it is the host's concern. On compose, under
ens develop, a gateway on ingress networks is reached over HTTPS through the
local proxy, and one nothing fronts serves HTTPS on 8443 from Caddy's own local
CA (kept on a named volume, so a recreated gateway doesn't invalidate a
certificate you already trusted). Outside a development session every gateway
serves plain HTTP, for the host's tunnel or proxy to end TLS in front of it.
Generic resource shapes
Everything else — messaging, any networking kind other than gateway, and
any databases/compute kind beyond the ones above (a key-value database, a
load-balancer, ...) — validates only against resourceDeclaration:
{ type, class?, capabilities? }. Its real fields are whatever a deploy kit's
provisioner expects; this schema doesn't check them, since no contract is
registered for that kind yet. Don't assume a kind not in the table above has any
particular field until you've checked the deploy kit you're targeting.
secrets, variables, external
description on a secret or a variable is optional free text saying what it is
for; it documents the manifest and changes nothing about a deploy.
secrets—{ source: "file" | "environment", description? }.ensnever mints a secret's value; it only wires whichever source you declare through to the deploy kit.source: fileis declared here but not yet implemented by either built-in kit (composeonly supportsenvironment, wired as a native${VAR:?}interpolation, so an unset one fails instead of deploying empty).variables—{ type?, default?, description? }, read fromens's own process environment at deploy time.external—{ type, name }. A resourceensdoesn't provision, only references by the name it already has outsideens's management (see--emulate-externalsin theens deployreference for the local-dev exception).
References inside a string
A reference may be the whole value (port: ${compute.web.http}) or sit inside a
larger string (host: dashboard.${variables.domain.value}). An embedded
${...} is only treated as a reference when it starts with a reference category
(compute., variables., external., release., …), so shell or compose
syntax such as ${HOME} passes through untouched. Each embedded reference must
resolve to a plain value on the target. One the target can only express as an
object, like CloudFormation's !GetAtt, fails the render, so use it as the
whole value instead.
operations
An operation is one command the workload declares, run by invocation —
ens operations <workload> <operation> [args...] — never fired by a deploy.
An operation that exits non-zero fails that invocation, its own exit code and nothing
else: no deploy has started, so there is nothing to roll back.
ens operations <workload> lists what the workload declares, one operation
per line: its name, a tab, then its description.
operations:
migrate:
description: Migrate the database schema
script: migrate.sh
arguments:
project: ${deployment.name}
artifact: ${deployment.artifact}
description is one sentence saying what the operation does; it is optional. Exactly
one of run (a shell one-liner, handed to sh -c) or script (a file under
ci/<workload>/<kit>/operations/, run with sh, so each deploy kit has its own)
drives the operation; both reject a .. segment or an absolute path, since ens
spawns whatever the path names. Trailing command-line arguments arrive as
$1..$n.
arguments are handed to the operation as environment variables, so each name
must be a shell-safe identifier — a dash, say, would make "$web-port" read as
a different variable in a shell. A value is a literal (string, number, boolean)
or a ${...} reference, resolved exactly as it would be inside a resource
field: ${compute.web.http} is the port that resource declares,
${databases.db.host} the host the provisioner produced, and a value that
resolves to a list or object is rejected rather than stringified. One namespace
is an operation's own, since it comes from the deploy invocation rather than the
manifest:
| Reference | What it is |
|---|---|
${deployment.name} |
The deployment's scoping name (<repo dir>-<workload>) — the same string a deploy passes the kit as -p/--name. |
${deployment.artifact} |
The path the deploy writes its rendered document to. |
${deployment.root} |
The repository root. |
That namespace is the reason operations exist: a script takes "$artifact" and
"$project" straight from its own environment and runs
docker compose -f "$artifact" -p "$project" exec -T gateway …, instead of
hardcoding the container or network name docker compose derives
(<project>-gateway-1, <project>_default) and a rename would silently break.
Secrets need no argument at all: the operation process inherits ens's environment,
which already carries your variables and secrets (plus any --env-file),
exactly as a deploy receives them.
mounts and development
mounts(on acontainercompute) —{ source, path, readOnly? }[], attaching astorage.volumeentry's${storage.<name>.name}output.development— whatens developkeeps current while it runs. Sync rules are grouped by action:sync(copy files) andsync+restart(copy, then restart the container), each rule{ app, path, ignore? }. Honored only by provisioners that support it. It adds nothing to the render: what differs between a development run and a deployment is avariablesentry, whichens developfills fromci/<name>/dev.env.
Capability negotiation
capabilities are accepted on every resource shape, and so is class (e.g.
critical) — except on a container compute and a gateway, which hold no
data of their own and take no class. A capability a kit can't satisfy hard-fails ens deploy unless you pass
--accept-capability-gaps. Some fields only materialize on certain kits given a
certain class — e.g. relational's deletionProtection only becomes a real
property on aws (RDS), not on compose, which has no equivalent to render it
into.
Ensemble