I have a build with multiple repositories so I'm using a plan variable to define the branch name so that all the repositories get checked out on the same branch for the build.
I defined a plan variable "repobranch". Each repository's branch field is set to ${bamboo.repobranch}. And I set the branch value for this variable on each branch of the plan. This all works great.
But then I wanted to use the branch name in my ant build scripts so I set an environment variable for the build: bamboo_branch=${bamboo.repository.branch.name}.
Now when the build runs, I get the following lines at the start of each task:
command 10-Oct-2013 16:32:27 Substituting variable: ${bamboo.buildNumber} with 110
command 10-Oct-2013 16:32:27 Substituting variable: ${bamboo.repository.branch.name} with ${bamboo.repobranch}
command 10-Oct-2013 16:32:27 Substituting variable: ${bamboo.build.working.directory} with C:\build\xml-data\build-dir\SFB-BAO-JOB1
So when I echo out ${ENV.bamboo_branch} in ant, the value is "${bamboo.repobranch}". That's the literal value that echos out.
I tried removing the repobranch variable from the whole plan and all branches on the plan, running it, then putting it back, but this problem is still occurring.
Any tips?
Kent