|
See Defining plan variables for information on defining plan variables. You can override a plan variable for a build, if you have triggered the build manually. For details, see Triggering a plan build manually.
The usage format for all plan variables is:
${bamboo.varName}
|
次のビルド固有の変数が初期設定で用意されています。
ビルド固有の変数 | ソース | 説明 |
|---|---|---|
bamboo.buildKey | Bamboo property | 現在のジョブのジョブ キー、"プロジェクト - 計画 - ジョブ" の形式、例: |
| bamboo.buildResultKey | Bamboo property | The result key when this job executes, in the form PROJECT-PLAN-JOB e.g. BAM-BOO-JOB1 |
| bamboo.buildResultsUrl | Bamboo property | ジョブの実行終了後の Bamboo 内での結果 URL |
bamboo.buildNumber | Bamboo property | Bamboo のビルド番号、例: |
bamboo.buildPlanName | Bamboo property | The Bamboo plan name e.g. |
bamboo.buildTimeStamp | Bamboo property | ビルドが開始された時刻、ISO 8601 形式、例: |
bamboo.buildForceCleanCheckout | Bamboo property | Whether the "Force Clean Build" option was used, values:true/false |
bamboo.build.working.directory | Bamboo property | The working directory that the build is being executed on |
| bamboo.ManualBuildTriggerReason.userName | Bamboo property | The user who triggered the manual build |
bamboo.repository.revision.number | プラグイン | The revision number |
| bamboo.repository.branch.name | The repository branch name (for Bamboo version 4.2 or later) | |
bamboo.repository.previous.revision.number | プラグイン | The previous revision number (might not exist if for example is initial build) |
bamboo.custom.svn.revision.number | プラグイン | (For Subversion only) The revision number |
bamboo.custom.svn.lastchange.revision.number | プラグイン | (For Subversion only) The last changed revision number |
bamboo.custom.svn.username | プラグイン | (For Subversion only) User name used for repository authentication |
bamboo.repository.svn.repositoryUrl |
| (For Subversion only) The repository url |
bamboo.custom.cvs.last.update.time | プラグイン | (For CVS only) The last updated timestamp |
bamboo.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 '_' |
bamboo.custom.p4.revision.number | プラグイン | (For Perforce only) The change set number |
bamboo.custom.p4.username | プラグイン | (For Perforce only) User name used for repository authentication |
bamboo.custom.p4.port | プラグイン | (For Perforce only) Port used for repository communication |
bamboo.custom.p4.client | プラグイン | (For Perforce only) Client used for repository communication |
| bamboo.repository.git.branch | (For Git only) The branch | |
| bamboo.repository.git.repositoryUrl | (For Git only) The repository url | |
bamboo.repository.hg.repositoryUrl |
| (For Mercurial only) The repository url |
bamboo.repository.hg.branch |
| (For Mercurial only) The branch |
bamboo.repository.hg.username |
| (For Mercurial only) User name used for repository authentication |
The usage format for all build-specific variables is:
${bamboo.varName}
|
Note that these JIRA variables can be accessed from a Bamboo build only when that build was triggered by releasing a version in JIRA.
| Jira 変数 | 説明 |
|---|---|
| ${bamboo.jira.baseUrl} | ご利用の Jira サーバーの URL |
| ${bamboo.jira.projectKey} | トリガーとなる Jira プロジェクトのキー |
| ${bamboo.jira.projectName} | トリガーとなる Jira プロジェクトの名前 |
| ${bamboo.jira.version} | トリガーとなる Jira プロジェクトのリリース バージョン |
| ${bamboo.jira.username} | リリース ビルドをトリガーしたユーザーのユーザー名 |
すべてのシステム変数に使用される形式は次のとおりです。
${system.<variable>}
|
For example, 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.
Bamboo の古いバージョンでは、(スクリプト タスクの) "環境変数" フィールドで "PATH" を使用しても Windows の PATH 変数は設定されませんが、"Path" を使用すると cmd シェルで Path と PATH が設定されます。
Bamboo variables are exported as bash shell variables. The name is converted to upper case and all full stops (periods) are converted to underscores. For example, the variable bamboo.my.variable is $BAMBOO_MY_VARIABLE in bash.
Variables can be used in the following fields of your build plan:
フィールド | グローバル | Build-specific | システム |
|---|---|---|---|
Goal (for Maven builders only) | |||
Build File (for Ant and NAnt builders only) | |||
Target (for Ant and NAnt builders only) | |||
Options (for NAnt builders only) | |||
Script (for Scripts only) | |||
Argument (for Scripts and Custom Commands only) | |||
Environment Variables | |||
Repository URL (for Subversion repositories only) | |||
Web Repository URL (for Subversion, CVS and Perforce repositories) | |||
CVS Root (for CVS repositories only) | |||
Branch name (for CVS repositories only) |
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.${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>} |
例:
|
機能をクリックすると、特定の機能キーが URL に含まれます。
URL のスペース文字は "+" の文字に置き換わります。変数として使用する場合は、スペース文字を含む機能ラベルを使用しないことをお勧めします。スペース文字の考えられる解決策は、「${}」記号でフォーマットすることですが、すべての場合にうまくいくわけではありません。
Global and Build-Specific Variables can be used in a specific fields of your build plan, as specified above. For capabilities,
例:
システム変数を指定しようとしているが、エージェントごとに異なる値を設定する場合は、次の手順を実行してください。
|