インデックス![]()
ダウンロード (PDF、HTML および XML 形式)
[Bamboo Knowledge Base Home]
Documentation for Bamboo 4.1.x. Documentation for earlier versions of Bamboo is available too. 
![]()
Bamboo global and build specific variables can be referred to in build scripts or maven pom.xml. Bamboo variables are not directly available in the builder execution context however.
They can be passed as parameters to the builder.
For example, you may want your Maven 2 version to be determined by Bamboo. In Maven 2 pom.xml you may have:
...
<groupId>com.atlassian.boo</groupId>
<artifactId>boo-test</artifactId>
<packaging>jar</packaging>
<version>1.1.${env.bambooBuildNumber}-SNAPSHOT</version>
...
You can then specify the following in the 'Goal' field of your build plan:
clean package -DbambooBuildNumber=${bamboo.buildNumber}
When the command runs, Bamboo will replace the buildNumber with the actual number (e.g. 1102), which will be passed to the underlying Maven build to use. The command will then produce a jar that looks like this: boo-test-1.1.1102-SNAPSHOT.jar.
You can pass bamboo variables as ant parameters along with ant targets like
clean test -Dbuild.key=${bamboo.buildKey}
In your ant build script just refer to this variable
...
<echo message="bamboo.buildKey = ${build.key}/>
...
1 Comment
Scott Deschenes
Sept 01, 2011I have Bamboo running on two separate servers. In both instances of Bamboo, I have the same plan set up in which I test passing parameters to an Ant task. The parameter I am passing is a path to a directory on the server in order to load flex tasks. This is the parameter I am passing: "C:\Program Files\Flex_SDK\flex_sdk_4.5.0.20967". On server A, the definitions load successfully. However, on server B, I get the following error message: Target "Files\Flex_SDK\flex_sdk_4.5.0.20967" does not exist in the project. In my ant script, I had an echo display the parameter I was passing and this is what I get: "[echo] flex.sdk = C:\Program". For the life of me, I can't figure out why one instance of Bamboo doesn't have any trouble with spaces in paths while the other instance of Bamboo is having trouble.
I tried escaping the white space, added quotes around the path, added quotes around the plan variable ("${bamboo.FLEX_PATH}").
Any help would be appreciated.
Thanks,
Scott Deschenes