Introduction to variables

Levels

Environment Variables can be defined on 4 levels:

  1. Workspace – available for all projects and pipelines. Configured on the dashboard view.
  2. Project – available for all pipelines in the project. Configured on the project view.
  3. Pipeline – available only for the pipeline in which it was defined. Configured in the Variables tab of the pipeline.
  4. 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

Adding new variableAdding new variable

Example usage

Let's configure some variables to encrypt access to an SFTP server:

  1. Go to the Variables tab in your deployment pipeline.
  2. Add variables and set your server credentials as values. For example:

    • $SFTP_HOST / 192.168.0.104
    • $SFTP_LOGIN / admin
    • $SFTP_PASS / buddy1234

Variables in pipelineVariables in pipeline

  1. Now you can use the variables to store access credentials to your deployment server:

Storing credentials with variablesStoring credentials with variables

Supported fields

To check if the input supports ENV VARs, click it and see if the dollar icon appears:

Variable icon in action inputVariable icon in action input

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 update:
Aug 6, 2024