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

Bamboo Plan Variables not working for me

Eric Hood May 23, 2016

I am having trouble making use of Plan Variables in Bamboo.

I added a plan variable, name: stuff, value: 1.2.3

 

In my "Default Job", I have a Script (File) task calling a command line utility, passing in a few parameters, including: ${bamboo.stuff}

Unfortunately, what is being passed is "${bamboo.stuff}", not "1.2.3"

Other built in bamboo properties are being passed in just fine, just not my plan variable.

I've tried: ${stuff}, $stuff, $bamboo.stuff, ${bamboo_stuff}, %STUFF%, %BAMBOO_STUFF%, and others, but I can't get it to respond.

What am I doing wrong?

2 answers

1 vote
SidduAngadi May 23, 2016

If it is Unix  — you should call ${bamboo.stuff}

windows -   %bamboo.stuff%

within java -   bamboo_stuff

These all worked for me.

If above does not worked, send me the version of bamboo, platform on which it is running and screenshot of variable and script.

 

Thanks

Siddu

Eric Hood May 24, 2016

Sorry, forgot to mention I'm in Windows.

The Script Task uses File as its location, and as an example of my Argument value:

-root="${bamboo.build.working.directory}" -test=${bamboo.stuff} -revision=${bamboo.repository.revision.number}

What I get passed to me, root and revision are replaced correctly.  But for test ==> ${bamboo.stuff}

Bamboo 5.11.1.1 (but still in trial-mode)

Capture.PNG

0 votes
rverschoor
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
May 24, 2016

Using ${bamboo.stuff} will only work if you use the Script Task with an inline script.
Bamboo will replace any variable references it sees there before it starts running the script.
If you let the Script Task with the script in a file, Bamboo will not get a chance to replace the variables.

So one solution would be to use an inline script instead of a file.

If you need to stick to a file script, you need to use the environment variables that Bamboo creates.
In your case you should be able to reference the variables with %BAMBOO_STUFF%.
You wrote that you already tried that, but it didn't work.
To investigate this, you can add a simple Script Task that just calls "set".
In the build log you can then see all environment variables. 

Eric Hood May 24, 2016

I tried your SET idea, and though it listed out nearly 100 items, "stuff" is nowhere in the list.  sad

ZillaYT May 22, 2017

For Linux style inline script, the ${bamboo.stuff} syntax did NOT work for me, that is when I do the following in my inline script

STUFF=${bamboo.stuff}

I get...

${bamboo.stuff}: bad substitution

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events