diff --git a/docs/guides/func_yaml.md b/docs/guides/func_yaml.md index c3d8b9be..e2ff24f5 100644 --- a/docs/guides/func_yaml.md +++ b/docs/guides/func_yaml.md @@ -28,6 +28,26 @@ field will contain all of the available builders for a given runtime. Although it's typically unnecessary to modify the `builder` field, using values from `builders` is OK. +### `buildEnvs` +This field allows you to set environment variables available to the builder/buildpack that builds the function. This environment variable is NOT set at runtime, use [envs](#envs) instead +1. Environment variable can be set directly from a value +2. Environment variable can be set from a local environment value. Eg. `'{{ env:LOCAL_ENV_VALUE }}'`, for more details see [Local Environment Variables section](#local-environment-variables). + +```yaml +buildEnvs: +- name: EXAMPLE1 # (1) env variable directly from a value + value: value +- name: EXAMPLE2 # (2) env variable from a local environment value + value: '{{ env:LOCAL_ENV_VALUE }}' +``` + +For example, the below `func.yaml` snippet modifies the default Golang buildpack to build source code with 1.15 compiler version. Refer to respective buildpack documentation to know more about environment variables that modify behavior of the `func build`. +```yaml +buildEnvs: +- name: BP_GO_VERSION + value: '1.15' +``` + ### `envs` The `envs` field allows you to set environment variables that will be