Config Files Reference

Below is the schema reference for the Project and Module garden.yml configuration files. For an introduction to configuring a Garden project, please look at our configuration guide.

The reference is divided into four sections. The first section lists and describes the available schema keys for the project level configuration, and the second section contains the project level YAML schema.

The third section lists and describes the available schema keys for the module level configuration, and the fourth section contains the module level YAML schema.

Note that individual providers, e.g. kubernetes, add their own project level configuration keys. The provider types are listed on the Providers page.

Likewise, individual module types, e.g. container, add additional configuration keys at the module level. Module types are listed on the Module Types page.

Please refer to those for more details on provider and module configuration.

Project configuration keys

apiVersion

The schema version of this project's config (currently not used).

Type

Required

Allowed Values

string

Yes

"garden.io/v0"

kind

Type

Required

Allowed Values

string

Yes

"Project"

name

The name of the project.

Type

Required

string

Yes

Example:

name: "my-sweet-project"

defaultEnvironment

The default environment to use when calling commands without the --env parameter.

Type

Required

string

No

environmentDefaults

DEPRECATED - Please use the providers field instead, and omit the environments key in the configured provider to use it for all environments, and use the variables field to configure variables across all environments.

Type

Required

object

No

Example:

environmentDefaults:
providers: []
variables: {}

environmentDefaults.providers[]

environmentDefaults > providers

DEPRECATED - Please use the top-level providers field instead, and if needed use the environments key on the provider configurations to limit them to specific environments.

Type

Required

array[object]

No

environmentDefaults.providers[].name

environmentDefaults > providers > name

The name of the provider plugin to use.

Type

Required

string

Yes

Example:

environmentDefaults:
providers: []
variables: {}
...
providers:
- name: "local-kubernetes"

environmentDefaults.providers[].environments[]

environmentDefaults > providers > environments

If specified, this provider will only be used in the listed environments. Note that an empty array effectively disables the provider. To use a provider in all environments, omit this field.

Type

Required

array[string]

No

Example:

environmentDefaults:
providers: []
variables: {}
...
providers:
- environments:
- dev
- stage

environmentDefaults.variables

environmentDefaults > variables

A key/value map of variables that modules can reference when using this environment. These take precedence over variables defined in the top-level variables field.

Type

Required

object

No

environments

A list of environments to configure for the project.

Type

Required

alternatives

No

Example:

environments: [{"name":"local","providers":[{"name":"local-kubernetes","environments":[]}],"variables":{}}]

providers

A list of providers that should be used for this project, and their configuration. Please refer to individual plugins/providers for details on how to configure them.

Type

Required

array[object]

No

providers[].name

providers > name

The name of the provider plugin to use.

Type

Required

string

Yes

Example:

providers:
- name: "local-kubernetes"

providers[].environments[]

providers > environments

If specified, this provider will only be used in the listed environments. Note that an empty array effectively disables the provider. To use a provider in all environments, omit this field.

Type

Required

array[string]

No

Example:

providers:
- environments:
- dev
- stage

sources

A list of remote sources to import into project.

Type

Required

array[object]

No

sources[].name

sources > name

The name of the source to import

Type

Required

string

Yes

sources[].repositoryUrl

sources > repositoryUrl

A remote repository URL. Currently only supports git servers. Must contain a hash suffix pointing to a specific branch or tag, with the format: #

Type

Required

string

Yes

Example:

sources:
- repositoryUrl: "git+https://github.com/org/repo.git#v2.0"

variables

Variables to configure for all environments.

Type

Required

object

No

Project YAML schema

apiVersion: garden.io/v0
kind: Project
name:
defaultEnvironment: ''
environmentDefaults:
providers:
- name:
environments:
variables: {}
environments:
providers:
- name:
environments:
sources:
- name:
repositoryUrl:
variables: {}

Module configuration keys

apiVersion

The schema version of this module's config (currently not used).

Type

Required

Allowed Values

string

Yes

"garden.io/v0"

kind

Type

Required

Allowed Values

string

Yes

"Module"

type

The type of this module.

Type

Required

string

Yes

Example:

type: "container"

name

The name of this module.

Type

Required

string

Yes

Example:

name: "my-sweet-module"

description

Type

Required

string

No

include

Specify a list of POSIX-style paths or globs that should be regarded as the source files for this module. Files that do not match these paths or globs are excluded when computing the version of the module, as well as when responding to filesystem watch events.

Note that you can also exclude files by placing .gardenignore files in your source tree, which use the same format as .gitignore files.

Also note that specifying an empty list here means no sources should be included.

Type

Required

array[string]

No

Example:

include:
- Dockerfile
- my-app.js

repositoryUrl

A remote repository URL. Currently only supports git servers. Must contain a hash suffix pointing to a specific branch or tag, with the format: #

Garden will import the repository source code into this module, but read the module's config from the local garden.yml file.

Type

Required

string

No

Example:

repositoryUrl: "git+https://github.com/org/repo.git#v2.0"

allowPublish

When false, disables pushing this module to remote registries.

Type

Required

boolean

No

build

Specify how to build the module. Note that plugins may define additional keys on this object.

Type

Required

object

No

build.dependencies[]

build > dependencies

A list of modules that must be built before this module is built.

Type

Required

array[object]

No

Example:

build:
...
dependencies:
- name: some-other-module-name

build.dependencies[].name

build > dependencies > name

Module name to build ahead of this module.

Type

Required

string

Yes

build.dependencies[].copy[]

build > dependencies > copy

Specify one or more files or directories to copy from the built dependency to this module.

Type

Required

array[object]

No

build.dependencies[].copy[].source

build > dependencies > copy > source

POSIX-style path or filename of the directory or file(s) to copy to the target.

Type

Required

string

Yes

build.dependencies[].copy[].target

build > dependencies > copy > target

POSIX-style path or filename to copy the directory or file(s) to (defaults to same as source path).

Type

Required

string

No

Module YAML schema

apiVersion: garden.io/v0
kind: Module
type:
name:
description:
include:
repositoryUrl:
allowPublish: true
build:
dependencies:
- name:
copy:
- source:
target: ''