Skip to content

Env

env is a string map passed to a component’s adapter operations.

components:
smoke:
type: script
runner: local
env:
BASE_URL: "http://localhost:${web.outputs._meta.ports.services.web.80}"

Values are interpolated before execution. Orch warns when environment keys look like credential or access-mechanism values, but it still passes them through.

Orch adds a small set of runtime variables to every component execution environment.

ORCH_WORKDIR is always available when an adapter command or lifecycle hook runs. It points at the component workdir on the runner for adapter operations, and at the selected hook workdir during hooks.

VariableAvailable inDescription
ORCH_ENV_IDAdapter operations, hooksCurrent Orch environment ID.
ORCH_COMPONENT_NAMEAdapter operations, hooksCurrent component name.
ORCH_COMPONENT_TYPEAdapter operations, hooksCurrent component adapter type.
ORCH_RUNNER_NAMEAdapter operations, hooksRunner executing the component.
ORCH_WORKDIRAdapter operations, hooksComponent workdir on the runner.

Lifecycle hooks also receive:

VariableAvailable inDescription
ORCH_LIFECYCLEHooksHook phase, such as pre_apply or post_destroy.

Adapters may add their own environment variables.

AdapterVariables
ScriptORCH_OUTPUT_ENV, ORCH_OUTPUT_JSON
Docker ComposeCOMPOSE_PROJECT_NAME

See each adapter page for adapter-specific behavior.