Skip to end of banner
Go to start of banner

How to add Environment Variables to the deployment project in Bamboo using CLI

Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 7 Next »

This article explains how to add environment variables to the deployment project in Bamboo Server using the Bamboo Command Line Interface app.

Instructions

For this task, use the deploymentProject and environment CLI actions as required parameters.

  • addEnvironmentVariablesAdd deployment environment variables. Use the field parameters for the variable name and the corresponding value parameters for the variable values.
  1. Log in as a Bamboo administrator.
  2. Ensure you have the Deployment project with Environment defined, to view all the deployment projects in the Bamboo instance, navigate to Deploy > All deployment projects.


  3. Click on Environment (Environment 2 as per the example) → Edit environment


  4. The below screenshot represents no variables defined.


  5. To add the environment variables, execute the below command:

    --action addEnvironmentVariables --deploymentProject DeployProject2 --environment Environment2 --field Inputfield1=InputValue1 --replace


  6. Below is the output on Terminal:

    Output on terminal
    --action addEnvironmentVariables --deploymentProject DeployProject2 --environment Environment2 --field Inputfield1=InputValue1 --replace
    
    Variable 'Inputfield1' added.
    1 variables updated or added to environment.
  7. Below is the output on Bamboo to see if variables are added:

  • It is recommended to test the commands in a non-production environment, or, run the action with --simulate parameter to verify the behaviour before deploying.
  • Ensure you have Bamboo Command Line Interface app installed in your Bamboo instance.
  • No labels