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

Get a list of deployment project variables

Hien September 18, 2022

Hi,

How can I go about to get a list of variables of a Bamboo deployment project?

Appreciate if you could, please, specify the version you are using.

Thanks

1 answer

1 accepted

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

Hello @HL

To obtain a list of variables available on a Deployment project you can:

  1. Add a script task to a Job within a Plan and run env on Linux or SET on Windows (or the equivalent PowerShell command)
  2. Add a "Dump variables to log configuration" task to your Plan

Both methods will print the environment variables that are accessible by Bamboo once the Plan is run.

You can then consume those variables in different ways.

Kind regards,

Eduardo Alvarenga
Atlassian Support APAC

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

Hien September 20, 2022

Hi @Eduardo Alvarenga ,

Thanks for your response. Answer is accepted.

I thought the following might be useful for those who are looking for similar solution - I am using version 6.10.3 and Linux elastic agents. The env command "displays" all variables which include:

- standard Linux environment variables

- built in variables

- global variables

...

- and deployment project variables

Except the Linux environment variables, the Bamboo variables are prefixed with bamboo_ 

For example,

build 21-Sep-2022 12:57:45 bamboo_my_dummy_var1=val1
build 21-Sep-2022 12:57:45 bamboo_my_dummy_var2=val2

where my_dummy_var1/2 and val1/2 are my deployment variables and values, respectively.

One might need to use the cut (or another util) command to capture the output of the env command.

Thanks again for your help!!

Like Eduardo Alvarenga likes this
Eduardo Alvarenga
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
September 20, 2022

Thank you for the details @HL I hope you are having a good experience with Bamboo!

Thank you,

Eduardo Alvarenga
Atlassian Support APAC

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

Like Hien likes this

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events