Besides the key-value syntax, the following properties can also be used under an environment variable definition to enhance its configuration. The following properties are available for environment variables declared in both pipelines and steps configuration
sections.
Important
Environment variable names set at pipeline-level must be unique. A step cannot include the same environment variable name as the one set at the pipeline-level.
Property | Description | Required/Optional | ||
---|---|---|---|---|
| Default value for the environment variable. | Required | ||
| Describes the environment variable usage. This description is displayed in the custom run configuration panel. | Optional | ||
| List of values that can be assigned to environment variables when custom run configuration is used in the UI. | Optional | ||
| Determines if users are allowed to use a custom value that is not part of the list of | Optional | ||
| Determines if users are allowed to use multiple values for an environment variable in a custom run. Default value is | Optional | ||
| Applicable when | Optional | ||
| Secure environment variables are encrypted variables that can be used in your pipelines without exposing their value. These environment variables are ideal for private information, such as passwords. When set as As shown in the example below, the
| Optional |
Example - Custom Values
pipelines: - name: my_pipeline configuration: environmentVariables: readOnly: env1: pipe_value1 env2: default: pipe_value2 description: This is env2 description values: - pipe_value2 - pipe_value3 - pipe_value4 steps: - name: my_step type: Bash configuration: environmentVariables: step_env1: default: step_value1 description: This is step_env1 description values: - step_value1 - step_value2 - step_value3 allowCustom: true step_env2: step_value5 step_env3: allowCustom: true secure: true default: "someValue" execution: onExecute: - echo "test"
When you trigger a run with custom configuration, the UI uses the configurations in the YAML file to control user input in the Run With Custom Configuration panel:
In the YAML, if allowCustom
is set as true
, you can enter any value for that field to define your own value for the run. In the example above, you can enter a custom value forstep_env2, in addition to the values that are already defined. Note that the custom value is available for a specific run only.
Example - Multiple Values
pipelines: - name: single_test configuration: environmentVariables: readOnly: env: default: "singletest" values: ["singletest", "testing"] allowCustom: false env2: "test_p2" env3: defaultMultipleValues: ["random_1"] description: "testing" values: ["random_1", "random_2", "random_3", "random_4"] allowCustom: false allowMultipleValues: true steps: - name: trigger_2 type: Bash execution: onExecute: - printenv - echo ${#env3[@]} - echo ${env3[0]}