Introduction to variables
Levels
Environment Variables can be defined on 4 levels:
- Workspace – available for all projects and pipelines. Configured on the dashboard view.
- Project – available for all pipelines in the project. Configured on the project view.
- Pipeline – available only for the pipeline in which it was defined. Configured in the Variables tab of the pipeline.
- Action – available only for the action in which it was defined. Configured in the Variables tab of the action.
Warning
Each subsequent tier will overwrite the value from the higher tier. For example, if you have two the same variables, but one is defined on the workspace level and another on the pipeline level, Buddy will use the pipeline value in that pipeline, and the workspace value in the rest of the workspace.
Configuration
When adding a new variable, the following fields are available:
- Name – the name of the variable, e.g.
$SFTP
- Value – the value conveyed by the name, e.g.
192.168.0.100
- Properties – options that let you hide the value of the variable in the logs, and mark the variable as settable, allowing you to change its value and pass it to the next action or pipeline run.
- Scope – defines the level of the variable
Image loading...
Example usage
Let's configure some variables to encrypt access to an SFTP server:
- Go to the Variables tab in your deployment pipeline.
Add variables and set your server credentials as values. For example:
$SFTP_HOST
/192.168.0.104
$SFTP_LOGIN
/admin
$SFTP_PASS
/buddy1234
Image loading...
- Now you can use the variables to store access credentials to your deployment server:
Image loading...
Supported fields
To check if the input supports ENV VARs, click it and see if the dollar icon appears:
Image loading...
Warning
Some fields are HTML textareas and do not support variable suggestions – for example, message fields in notifications. They do support ENV VARs perfectly fine, however.
Success
You can also use multi-line environment variables if required.
Last modified on Sep 23, 2024