Is it possible to create a new global variable which includes a system variable?
For example, I want to create a global variable for MSBuild options that I can use with each of my projects. In this global variable, I want to reference ${bamboo.buildnumber}. When I include the system variable, it does not get evaluated though. It's coming through as -Version "1.0.${bamboo.buildNumber}"
Is there a way to have this evaluated?
You could potentially just use 2 variables... use the global variable for the first 2 numbers of your version number, and then use the ${bamboo.buildNumber} as the 2nd variable...
so in your scripts or where you pass arguments instead of passing in a single bamboo variable for the version, you can just concat 2 of them together
${bamboo.buildNumberPrefix}.${bamboo.buildNumber}
That's what I ended up doing, and that worked as I wanted. Thanks.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
What you'd need is nested evaluation of variables, which is not supported atm. You can create an improvement request for it here: jira.atlassian.com .
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I am assuming that you have a build script that is a part of your repositor that you are executing. If you have the ${bamboo.buildNumber} in there, then it will not be resolved.
The ${bamboo.buildNumber} variable will be resolved when you pass it in as an argument to your script when your task executes it, or if you use inline scripting option as a task.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
It's not a script. In Bamboo, I go to Administration->Global Variables and add the variable with text "/p:Version=1.0.${bamboo.buildNumber}". Then I go to my Plan->Configure Plan->Stages->Default Job->Tasks->MSBuild, and enter ${bamboo.myMsBuildOptions} in the Option text box. The string that gets passed to MSBuild includes the variable NAME ${bamboo.buildNumber} , not the variable value. This does NOT get parsed into "1.0.43" like I'd expect.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.