How to access Bamboo variables in an msbuild task

Douglas Mccorison May 14, 2014

I am trying to create a new msbuild task. I would like to use some of the Bamboo variables in the task (specifically bamboo.repository.revision.number in this case, but I have the same problem in other cases). I have set up the build to diagnostic verbosity (/v:diag) so I can see all the environment variables. Any Plan variables I have manually created show up in the environment, but none of the built-in variables show up.

I have tried setting the variables in the Plan varaibles section, but that does not seem to work. I have tried setting them on the Options and that did not work. I have tried using both %...% and ${...} syntax in both fields on the MSBuild configuration page.

So, how do I set up the MSBuild task to any Bamboo global/build/project variables are available to the build script?

3 answers

0 votes
Chuck Ma April 6, 2016

Doug,  

I had the same problem but I had "Invalid value for 'AssemblyVersion' " in my log. 

problem was the version number. I used something like:  v.5.0.9.100,  turns out I need to remove the "v." 

I can confirm that ${xxx.xxx.xxxxxx} works . 

 

Good luck.

0 votes
Douglas Mccorison May 14, 2014

I've checked, it is spelled correctly, but that is not the problem.

Note: the /v:diag option to MSBuild shows all environment variables for that build. None of the bamboo variables listed in their documentation appear in the list of environment variables available to to build. The manually created variables are present, but not the automatic variables.

0 votes
Jason Monsorno
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 14, 2014

You misspelled "revision" in the question, is it possible you misspelled it in your MSBuild task?

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events