Skip to main content
Version: 0.199.1

Predefined variables

Terrabuild supplies predefined values for the current run, machine, project, and target.

NameDescriptionScope
terrabuild.configurationName of current configurationGlobal
terrabuild.environmentName of current environmentGlobal
terrabuild.branch_or_tagName of current branch or tagGlobal
terrabuild.head_commitHead commit hashGlobal
terrabuild.retrytrue if build is retried.Global
terrabuild.forcetrue if build is forced.Global
terrabuild.citrue if build is running in known CI.Global
terrabuild.engineContainer engine used.Global
terrabuild.debugtrue if debug is enabled.Global
terrabuild.tagTag provided by user or nothing.Global
terrabuild.noteNote provided by user or nothing.Global
terrabuild.groupBuild group identifier provided by user or nothing.Global
terrabuild.osdarwin, windows, linux or nothing if unknown.Global
terrabuild.archarm64, amd64 or nothing if unknown.Global
terrabuild.project_slugSlug of current project (relative path from workspace)Target
terrabuild.projectId of current project if definedTarget
terrabuild.phaseName of current phase or nothing if the target is unphasedTarget
terrabuild.targetName of current targetTarget
terrabuild.versionVersion (hash) of current projectTarget
project.<id>.versionVersion (hash) of given project <id>Target

Environment-sensitive inputs

Terrabuild classifies the following predefined values as environment-sensitive:

  • terrabuild.environment
  • terrabuild.branch_or_tag
  • terrabuild.head_commit
  • terrabuild.ci
  • terrabuild.tag
  • terrabuild.note
  • terrabuild.group

When a selected target consumes one of these values directly or through a local or extension configuration, declare environment_sensitive = true on the project target or its workspace target default. A neutral consumer fails before operation resolution and reports every target and input that requires an opt-in. Opted-in sensitive value hashes participate in the target cache key. Diagnostic JSON, terrabuild explain, and the local console expose the status while keeping values hashed.