Skip to content

Environment

Definition of an Environment on repository level, the following properties are supported:

Key Value Description Notes
name string The name of the environment
wait_timer int The amount of time to wait before allowing deployments to proceed
reviewers list[Actor] Users or Teams that may approve workflow runs that access this environment
deployment_branch_policy string Limit which branches can deploy to this environment based on rules or naming patterns all, protected or selected
branch_policies list[string] List of branch patterns which can deploy to this environment only applicable if deployment_branch_policy is set to selected

Jsonnet Function

orgs.newEnvironment('<name>') {
  <key>: <value>
}

Validation rules

  • specifying a non-empty list of branch_policies while deployment_branch_policy is not set to selected triggers a warning

Example usage

orgs.newOrg('OtterdogTest') {
  ...
  _repositories+:: [
    ...
    orgs.newRepo('test-repo') {
      ...
      environments: [
        orgs.newEnvironment('linux') {
          deployment_branch_policy: "protected",
          reviewers+: [
            "@OtterdogTest/eclipsefdn-security",
            "@netomi"
          ],
          wait_timer: 30,
        },
      ]
    }
  ]
}