You can use variables to help define other variables. Use `$$` to ignore a variable
name inside another variable:
Use the [`value` and `description`](../yaml/index.md#prefill-variables-in-manual-pipelines)
keywords to define [variables that are prefilled](../pipelines/index.md#prefill-variables-in-manual-pipelines)
for [manually-triggered pipelines](../pipelines/index.md#run-a-pipeline-manually).
### Use variables or `$` in other variables
You can use variables inside other variables:
```yaml
variables:
FLAGS:'-al'
LS_CMD:'ls"$FLAGS"$$TMP_DIR'
script:
-'eval"$LS_CMD"'# Executes 'ls -al $TMP_DIR'
job:
variables:
FLAGS:'-al'
LS_CMD:'ls"$FLAGS"'
script:
-'eval"$LS_CMD"'# Executes 'ls -al'
```
Use the [`value` and `description`](../yaml/index.md#prefill-variables-in-manual-pipelines)
keywords to define [variables that are prefilled](../pipelines/index.md#prefill-variables-in-manual-pipelines)
for [manually-triggered pipelines](../pipelines/index.md#run-a-pipeline-manually).
If you do not want the `$` interpreted as the start of a variable, use `$$` instead:
```yaml
job:
variables:
FLAGS:'-al'
LS_CMD:'ls"$FLAGS"$$TMP_DIR'
script:
-'eval"$LS_CMD"'# Executes 'ls -al $TMP_DIR'
```
### Add a CI/CD variable to a project
...
...
@@ -374,26 +387,6 @@ WARNING:
When you store credentials, there are [security implications](#cicd-variable-security).
If you use AWS keys for example, follow the [Best practices for managing AWS access keys](https://docs.aws.amazon.com/general/latest/gr/aws-access-keys-best-practices.html).