|
All Versions
Bamboo 1.1 Documentation
|
Since Bamboo 1.1, you can add variables in your build command that Bamboo will evaluate at build time. To add a custom variablem use the following format: ${bamboo.<your_variable>}. The source of the variable can either be one of the default plugins (see 9.1 About Bamboo Plugins for a list) or a global variable value (see 2.3 Configuring Global Variables for more information). By default you can use the following properties (prefix them with bamboo):
Maven example 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 ${bamboo.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. |
