From 9b01368418d7c29d51a778de67455fe621b74b8c Mon Sep 17 00:00:00 2001 From: Preetham <18009299+pmgk07@users.noreply.github.com> Date: Mon, 25 Oct 2021 18:28:38 +0530 Subject: [PATCH] docs: documentation for `buildEnv` (#592) * Doc for func.yaml's buildEnv * Update docs/guides/func_yaml.md Co-authored-by: Zbynek Roubalik <726523+zroubalik@users.noreply.github.com> Co-authored-by: Zbynek Roubalik <726523+zroubalik@users.noreply.github.com> --- docs/guides/func_yaml.md | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) 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