Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Defining environment variables

Karen West
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
September 14, 2022

Hello - I want to define an environment variable in bamboo so that certain tasks are completed during execution. How do I do this through the web interface? bamboo_run script is looking for the value of this variable and I want to set it to true instead of false so that it performs the task from within bamboo. 

1 answer

0 votes
Eduardo Alvarenga
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
September 14, 2022

Hello @Karen West

Welcome to Atlassian Community!

In your Plan configuration, you can use a Script Task or any other task that would create a variables file, then add an Inject Variables task that would consume that file.

The Inject Bamboo variables task allows you to read the values for variables from a file, and create those variables in your build plan.

The file should use a 'key=value' format. Note that starting from Bamboo version 5.14, you must provide relative paths to the property file.

You can choose if those variables should have a local scope (in which case they cease to exist when the job finishes) or result scope (in which case they are persisted and passed into subsequent stages or related deployment releases).

Then, after the variables are set you can configure a Conditional Task to evaluate the new variable and then proceed with its execution in case it matches.

Thank you,

Eduardo Alvarenga
Atlassian Support APAC

--please don't forget to Accept the answer if the reply is helpful-- 

Karen West
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
September 14, 2022

Thank you Eduardo. I will try that tomorrow and let you know if it solved my issue.

Cheers - Karen West

Like Eduardo Alvarenga likes this

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events