Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 21 additions & 8 deletions sites/upsun/src/development/variables/set-variables.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,12 +68,13 @@

Variables have several Boolean options you can set in the Console or the CLI:

| Option | CLI flag | Default | Description |
|-----------|---------------------|---------|--------------------------------------------------------------------------------------------------------------------------------------------------------|
| JSON | `--json` | `false` | Whether the variable is a JSON-serialized value (`true`) or a string (`false`). |
| Sensitive | `--sensitive` | `false` | If set to `true`, the variable's value is hidden in the Console and in CLI responses for added security. It's still readable within the app container. |
| Runtime | `--visible-runtime` | `true` | Whether the variable is available at runtime. |
| Build | `--visible-build` | `true` | Whether the variable is available at build time. |
| Option | CLI flag | Default | Description |
|---------------------|-----------------------|---------|--------------------------------------------------------------------------------------------------------------------------------------------------------|
| JSON | `--json` | `false` | Whether the variable is a JSON-serialized value (`true`) or a string (`false`). |
| Sensitive | `--sensitive` | `false` | If set to `true`, the variable's value is hidden in the Console and in CLI responses for added security. It's still readable within the app container. |
| Runtime | `--visible-runtime` | `true` | Whether the variable is available at runtime. |
| Build | `--visible-build` | `true` | Whether the variable is available at build time. |
| Application scope | `--app-scope` | — | Limits the variable visibility to specific app(s) and/or their workers. By default, the variable is available across all applications. |

Check failure on line 77 in sites/upsun/src/development/variables/set-variables.md

View workflow job for this annotation

GitHub Actions / vale

[vale] sites/upsun/src/development/variables/set-variables.md#L77

[Platform.plurals] Don't use plurals in parentheses such as in 'app(s)'.
Raw output
{"message": "[Platform.plurals] Don't use plurals in parentheses such as in 'app(s)'.", "location": {"path": "sites/upsun/src/development/variables/set-variables.md", "range": {"start": {"line": 77, "column": 102}}}, "severity": "ERROR"}

So if you want the `foo` variable to be visible at build time but hidden during runtime,
you can set it by running the following command:
Expand All @@ -88,9 +89,21 @@
```bash
{{% vendor/cli %}} variable:update foo --visible-build false --visible-runtime true
```
#### Limiting variables to specific applications

Note that for changes to project variables to have effect,
you need to [redeploy](../troubleshoot.md#force-a-redeploy) your environments.
If you want the `foo` variable to be available only to certain applications and/or their workers, you can limit its scope using the `--app-scope` option:

```bash
upsun variable:create --level project --name foo --value bar --app-scope frontend1,frontend2
```

Where `frontend1` and `frontend2` are the names of your applications.

{{< note theme="Info" >}}

Note that for changes to project variables to have effect, you need to [redeploy](../troubleshoot.md#force-a-redeploy) your environments.

{{< /note >}}

## Create environment-specific variables

Expand Down
Loading