I read this post, which seems to indicate that I can access build-specific variables directly from my script, instead of having to pass each one in via the Environment Variable box in the Script Configuration pane in Bamboo. I am not finding this to be the case, and am wondering if I am missing something.
Basically, I want to be able to arbitrarily access all of the following build specific variables via my perl script, which is called in a pre-build script in order to apply these values to the version in our app:
${bamboo.buildPlanName}
${bamboo.buildKey}
${bamboo.buildNumber}
${bamboo.buildResultKey}
${bamboo.buildTimeStamp}
${bamboo.repository.revision.number}
${bamboo.build.working.directory}
I know that I can use a line similar to the following in the Script Configuration / Environment Variables box:
RESULTSDIR="${bamboo.build.working.directory}/test-reports" BUILDNUM="${bamboo.buildNumber}" etc...
I'd like to not have to include this line every time I use the script in my Bamboo plan. Is there a way to directly access them, as the above mentioned post seems to indicate?
In the Job log there is a note stating that my globals are passed in to the environment of the remote agent that is running the perl script (a Windows box, if it matters). The build-specific variables, however, are not passed in this fashion. I tried to use a build-specific variable in the "Value" field of a global, but not suprisingly, they are not interpolated. (See screen shot).
If I have to manually pass these in everytime I run the script, it's not the end of the world, but if there is something I'm overlooking, I'd love to hear about it.
Thanks!
