Skip to content

devlanes is in beta and not ready for production use.Report an issue

Expressions

Values in the project file and the local file can hold ${{ ... }} expressions, which devlanes evaluates for each lane. Environment and expressions explains where their values go.

FormMeaning
${{ expression }}An expression, in the expression language of MiniJinja templates.
text ${{ a }} textText with expressions in it. The result is text.
${{ '${{' }}A literal ${{.
${{ a | default('x') }}A filter. Filters and tests are MiniJinja’s built-in ones, such as default, upper, replace, join, int, tojson and is defined.
${{ ‘a’ if lane.index == 0 else ‘b’ }}A condition.

A value that is one whole expression keeps its type, so autostart: ${{ lane.index == 0 }} is a boolean. Text with an expression in it is text. A name that does not exist is an error; default gives it a value.

NameValue
project.nameproject from the project file.
project.primary_pathThe path of the primary worktree.
lane.indexThe lane number: 0, 1, 2 and so on.
lane.namemain for lane 0, lane<N> for lane N.
lane.labelThe branch with each / replaced by -, such as feat-checkout.
lane.pathThe path of the lane’s worktree.
lane.data_pathThe lane data folder.
lane.domainThe lane domain: myapp.localhost in lane 0, myapp1.localhost in lane 1.
lane.portThe first port of the lane’s port block.
lane.An entry of lanes.vars.
self.nameThe name of the service the value belongs to.
self.portIts port.
self.ports.Its named port <name>.
self.urlhttp://127.0.0.1:<port>.
self.public_urlhttps:// and its first hostname. Undefined for a service without hostnames.
self.hostsIts hostnames.
services..The same fields for another service of the lane.
lanes.main.services..The same fields for a service of lane 0.
projects..services..The same fields for a service of another running project.
infra..portThe host port of a container’s first published port.
infra..ports[‘’]The host port published for a container port of a Compose service.
infra..ports.The host port of a named port of an infra.containers entry.
env.A variable from the shell that ran the devlanes command, else from the lane’s .env file.
replica.index, replica.countThe replica’s number, from 1, and the service’s replicas.

In a task, self holds only name. infra.containers, infra.compose, infra.hosts, infra.env and infra.external read only project, lane, infra and env.

A name with a dash is written services['crm-api'] or services.crm_api.

FunctionResult
domain(name)The domain of name in this lane, by the rule of lane.domain: pages.localhost in lane 0, pages2.localhost in lane 2.