すべてのバージョン
Bamboo 5.13Bamboo 5.7.x
Bamboo 5.6.x
More...
このページの内容
When configuring a plan, you may want to specify variables to be used in the build process. There are three types of variables available to you:
ビルド固有の変数 |
ソース |
説明 |
---|---|---|
buildKey |
Bamboo property |
The plan key for the build, e.g. |
buildNumber |
Bamboo property |
Bamboo のビルド番号、例: |
buildPlanName |
Bamboo property |
The Bamboo plan name e.g. |
buildTimeStamp |
Bamboo property |
The time when build was started in ISO 8601 format |
buildForceCleanCheckout |
Bamboo property |
Whether the "Force Clean Build" option was used, values:true/false |
custom.svn.revision.number |
プラグイン |
(For Subversion only) The revision number |
custom.svn.lastchange.revision.number |
プラグイン |
(For Subversion only) The last changed revision number |
custom.svn.username |
プラグイン |
(For Subversion only) User name used for repository authentication |
custom.cvs.last.update.time |
プラグイン |
(For CVS only) The last updated timestamp |
custom.cvs.last.update.time.label |
プラグイン |
(For CVS only) The last updated timestamp to be used as a label for post build result labelling. The spaces in the cvs version string are replaced with '_' |
custom.p4.revision.number |
プラグイン |
(For Perforce only) The change set number |
custom.p4.username |
プラグイン |
(For Perforce only) User name used for repository authentication |
custom.p4.port |
プラグイン |
(For Perforce only) Port used for repository communication |
custom.p4.client |
プラグイン |
(For Perforce only) Client used for repository communication |
The usage format for all global and build-specific variables is:
${bamboo.<variable>}
すべてのシステム変数に使用される形式は次のとおりです。
${system.<variable>}
e.g. if you have a system variable MYPATH=C:\MyPath;
you can use a Bamboo system variable system.MYPATH
which will inherit the same value as the system variable.
Variables can be used in the following fields of your build plan:
フィールド |
Available variables |
---|---|
Goal (for Maven builders only) |
Global variables |
Build File (for Ant and NAnt builders only) |
Global variables |
Target (for Ant and NAnt builders only) |
Global variables |
Options (for NAnt builders only) |
Global variables |
Script (for Scripts only) |
Global variables |
Argument (for Scripts and Custom Commands only) |
Global variables |
System Environment Variables |
Global variables |
Repository URL (for Subversion repositories only) |
Global variables |
Web Repository URL (for Subversion, CVS and Perforce repositories) |
Global variables |
CVS Root (for CVS repositories only) |
Global variables |
Branch name (for CVS repositories only) |
Global variables |
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 then specify the following in the 'Target' field of your build plan:
-f build.xml -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 Ant build to use.
グローバル変数と同じ方法で使用する機能を指定することもできます。
機能の形式は次のようにする必要があります。
${bamboo.capability.<capability_key>}
例:
${bamboo.capability.<capability_key>}
${bamboo.capability.system.jdk.<jdk_label>}
${bamboo.capability.system.builder.<builder_type>.<builder_label>} e.g. ${bamboo.capability.system.build.maven.Maven1}
${bamboo.capability.system.p4Executable}
機能をクリックすると、特定の機能キーが URL に含まれます。
URL のスペース文字は "+" の文字に置き換わります。変数として使用する場合は、スペース文字を含む機能ラベルを使用しないことをお勧めします。スペース文字の考えられる解決策は、「${}」記号でフォーマットすることですが、すべての場合にうまくいくわけではありません。
Global and Build-Specific Variables can be used in a specific fields of your build plan, as specified above. For capabilities,
例:
システム変数を指定しようとしているが、エージェントごとに異なる値を設定する場合は、次の手順を実行してください。
${bamboo.capability.thatsystemvariable}