Skip to content

Commit 72aac59

Browse files
authored
env variables update (#190)
1 parent 1b6f0c7 commit 72aac59

File tree

1 file changed

+14
-6
lines changed

1 file changed

+14
-6
lines changed

apps/docs/content/features/env-variables.mdx

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ These variables are defined with `envVariables` attribute in the `build` or `run
3636
DB_PASS: password
3737
```
3838
39-
See how to [reference variables](#referencing-variables) between services and deployment phases.
39+
See how to [reference variables](#referencing-variables) between services and between build and runtime environments.
4040
4141
:::note
4242
Your application must be redeployed when updating environmental variables in `zerops.yml`.
@@ -166,15 +166,23 @@ setup: app
166166
dbConnection: ${dbtest_connectionString}
167167
```
168168

169-
#### Between Build and Runtime
170-
Prefix variables with `RUNTIME_` or `BUILD_`:
171-
```yml
169+
#### Between Build and Runtime Environments
170+
171+
Build and runtime are two distinct environments in Zerops. Each environment can have its own set of variables, and you can use the same variable names in both environments since they are separate. Due to this separation, variables defined in one are not automatically accessible in the other.
172+
173+
To share variables between environments, you need to use specific prefixes:
174+
- Use `RUNTIME_` prefix to access runtime variables during build
175+
- Use `BUILD_` prefix to access build variables during runtime
176+
177+
Here's an example of `zerops.yml` file showing how to reference a runtime variable during build:
178+
179+
```yml title="zerops.yml"
172180
build:
173181
envVariables:
174-
variable: ${RUNTIME_someVariable}
182+
API_KEY: ${RUNTIME_API_KEY} # Using runtime variable during build
175183
run:
176184
envVariables:
177-
someVariable: hello world
185+
API_KEY: "12345-abcde" # Referenced in build with RUNTIME_ prefix
178186
```
179187

180188
#### Project Variables

0 commit comments

Comments
 (0)