lock_policy
The lock_policy configuration specifies, for the whole repository, under what situations Terrateam acquires a lock on a directory and workspace. It is the default for every directory, including those that do not match any workflow. A lock_policy set on a workflow entry overrides this value for the directories that match that workflow.
Default Configuration
Section titled “Default Configuration”lock_policy: strict| Key | Type | Description |
|---|---|---|
| lock_policy | String | When a directory should have a lock acquired. Values are strict (acquire a lock if either it is merged or applied), apply (only acquire a lock when it is applied), merge (only acquire a lock when it is merged), and none (never acquire a lock). Default is strict. |
Examples
Section titled “Examples”Setting the Policy for the Whole Repository
Section titled “Setting the Policy for the Whole Repository”lock_policy: applyEvery directory only acquires a lock when it is applied.
Overriding the Policy for Some Directories
Section titled “Overriding the Policy for Some Directories”lock_policy: apply
workflows: - tag_query: dir:production lock_policy: strictDirectories under production use strict, everything else inherits apply from the global key.
Considerations
Section titled “Considerations”- Be careful when modifying
lock_policy. Any value other thanstrictis considered less safe, but can be useful in the right situation. - See Lock Management for a description of each policy and when a lock is acquired and released.