This article explains how to add environment variables to a deployment project in Bamboo Server using the Command Bamboo Command Line Interface app.
Instructions
For this task, use the CLI action addEnvironmentVariables with deploymentProject and environment as required parameters.
- addEnvironmentVariables: Add deployment environment variables. Use the field parameters for the variable name and the corresponding value parameters for the variable values.
- Log in as a Bamboo administrator.
Ensure you have the Deployment project with Environment defined. To view all deployment projects in the Bamboo instance, navigate to Deploy > All deployment projects.
- Click on Environment (Environment 2 as per the example) → Edit environment.
- The below screenshot shows no variables defined.
To add the environment variables, execute the below command:
Code Block theme Midnight --action addEnvironmentVariables --deploymentProject DeployProject2 --environment Environment2 --field Inputfield1=InputValue1 --replace
Below is the output on Terminal:Code Block theme Midnight title Output on terminal --action addEnvironmentVariables --deploymentProject DeployProject2 --environment Environment2 --field Inputfield1=InputValue1 --replace Variable 'Inputfield1' added. 1 variables updated or added to environment.
Below is the output on Bamboo to verify if variables are added:
Info |
---|
|
...