How to use environment variables?
Environment variables are pairs of key-and-value that can be used in Buddy pipelines instead of manually updating the same values across the system on every change. They are most commonly used for authentication credentials, allowing developers to save time looking up and entering access details and eliminating the risk of providing sensitive details in their scripts.
Please mind you need to be an admin to edit environment variables
Let's use the variables to encrypt access to an FTP server:
- Go to your deployment pipeline and click the Variables tab
Add variables the with corresponding values. For example:
Always choose strong passwords for your credentials. You can also encrypt values so they won’t be presented in plain text.
If you use SSH, you can store your keys as variables, too.
Go back to your pipeline and click the upload action
Enter the variables in the corresponding inputs in the following format:
Buddy will automatically suggest the variables once you start typing.
Click Test connection to see if everything's been configured correctly.
The variables are divided into three tiers:
- Workspace (available from Dashboard → Preferences)
- Project (available from Project options)
- Pipeline (available from pipeline overview)
Each subsequent tier will overwrite the values from the previous tier.