mirror of https://github.com/knative/func.git
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>
This commit is contained in:
parent
f161d50084
commit
9b01368418
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue