Scope and configuration

Scope

Environment variables can be defined in four different scopes:

  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

Image loading...Adding 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

Image loading...Variables in pipeline

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

Image loading...Storing credentials with variables

Supported fields

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

Image loading...Variable 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 modified on Sep 23, 2024