Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,365,033
Community Members
 
Community Events
168
Community Groups

Get a list of deployment project variables

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

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-- 

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

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 HL likes this

Suggest an answer

Log in or Sign up to answer
TAGS

Atlassian Community Events