Bamboo が提供する幅広いオプションを利用すると、リリースの命名スキームを制御できます。Bamboo によるリリース バージョニングの処理方法を指定し、リリース間の自動インクリメントを制御できます。
Bamboo では、以下の機能を利用できます。
- シンプルなインクリメント採番
- Bamboo 変数に基づく高度な採番
Bamboo では、新しいリリースを作成するときに、自動リリース設定を手動で上書きすることもできます。
On this page:
シンプルなリリース バージョニング
シンプルなリリース バージョニングでは、リリースの開始番号(例えば、1.0)を指定できます。Bamboo はこの番号から自動的にインクリメントします。シンプルなリリース バージョニングを使用する場合、Bamboo はリリース名に含まれる最後の番号をインクリメントします。次に例を示します。
| リリース名 | インクリメントされたリリース名 |
|---|---|
| 1 | 2 |
| 1.1 | 1.2 |
| 1.11 | 1.12 |
| 1.0.1 | 1.0.2 |
シンプルなリリースの命名を設定する方法
「デプロイ プロジェクトの設定」画面の [Release versioning(リリース バージョニング)] ボタンをクリックして、「リリース バージョニング」画面を表示します。
次のフィールドを使用して、「リリース バージョニング」画面の入力を完了します。
フィールド説明Optional?Create release name(リリース名の作成) Bamboo が作成する次のリリース名の識別情報。シンプルなリリースの命名では、1.0 のような分かりやすいものを使用する必要があります。 Automatically increment with each new release(新しいリリースごとに、自動的にインクリメント) [Numbers(番号)] チェックボックスをオンにすると、前述した [Next release name(次のリリース名)] フィールドに従ってリリース番号が自動的にインクリメントされます。このチェックボックスをオフのままにしておくと、リリース番号はインクリメントされません。 プレビュー このフィールドでは、次のリリース名がどのようになるかをプレビューできます。プレビューを表示するには、[Create release name(リリース名の作成)] フィールドの横にある [プレビューを生成] ボタンをクリックします。
注意: 場合によっては、プレビューを利用できないことがあります。
- [保存] ボタンをクリックして変更を保存します。
変数を使用したリリース バージョニング
変数を使用したリリース バージョニングでは、Bamboo 内で設定された変数に基づいて、より複雑な命名スキームを作成できます。リリース スキーム内では、グローバル変数、プラン変数、およびビルド変数を使用できます。
例
「m6」という値を持つプラン変数「planvar」があるとします。この変数キーを [Next release name(次のリリース名)] フィールドに含めることで、Bamboo は変数値を次のリリース名に自動的に追加し、適宜インクリメントしていきます。
| 変数キー | 変数の値 | 次のリリース名 | 次のリリース | 後続のリリース |
|---|---|---|---|---|
| planvar | m6 | 1.0-${bamboo.planvar} | 1.0-m6 | 1.1-m7 |
変数を使用したリリースの命名を設定する方法
- Click the Release versioning button on the 'Deployment project configuration' screen to display the 'Release naming' screen:
次のデータを使用して、[Create release name(リリース名の作成)] フィールドを入力します。
フィールド説明Optional?バージョン Bamboo が作成する次のリリース名の識別情報。シンプルなリリース バージョニングでは、1.0 のような分かりやすいものを使用する必要があります。 - Click on the Add variable to release name link to display the Variables selection screen:
- [変数を追加] をクリックして、変数をリリースの命名スキームに含めます。[閉じる] をクリックして「リリースの命名」画面に戻ります。
次のフィールドを使用して、[リリース名] フィールドを入力します。
フィールド説明Optional?Automatically increment with each new release(新しいリリースごとに、自動的にインクリメント) 1. [Numbers(番号)] チェックボックスをオンにすると、前述した [Next release name(次のリリース名)] フィールドに従ってリリース番号が自動的にインクリメントされます。このチェックボックスをオフのままにしておくと、リリース番号はインクリメントされません。
2.リリース番号の自動インクリメントのプランに任意の変数を含めるには、[変数] チェックボックスをオンにします。プレビュー このフィールドでは、次のリリース名がどのようになるかをプレビューできます。プレビューを表示するには、[Create release name(リリース名の作成)] フィールドの横にある [プレビューを生成] ボタンをクリックします。
注意: 場合によっては、プレビューを利用できないことがあります。
- [保存] ボタンをクリックして変更を保存します。
リリース バージョニングのスキーム例
Bamboo also allows you to use combinations of simple and variable release naming. The following table provides examples of combined naming schemes, and demonstrates how careful control of the Numbers and Variables checkboxes can be used to customise your scheme.
| 命名スキーム | 次のリリース フィールド | [Numbers(番号)] チェックボックス | [変数] チェックボックス | Variable value | 次のリリース名 | 後続のリリース名 |
|---|---|---|---|---|---|---|
| 固定された名前 | 1.0 | - | 1.0 | 1.0 | ||
| 本質的に一意の変数 | 1.0-${bamboo.buildNumber} | 13 | 1.0 ~ 13 | 1.0 ~ 13 | ||
| 番号のインクリメント | 1.0 | - | 1.0 | 1.1 | ||
| 番号のインクリメント + 固定変数 | 1.0-${bamboo.appName} | ${bamboo.appName} プランまたはグローバル変数: Awesome | 1.0-Awesome | 1.1-Awesome | ||
| 変数のインクリメント | 1.0-${bamboo.milestone} | ${bamboo.milestone} プランまたはグローバル変数: m6 | 1.0-m6 | 1.0-m7 | ||
| 番号と変数のインクリメント | 1.0-b${bamboo.appNumber} | ${bamboo.appNumber} ユーザー定義変数: 1567 | 1.0-b1567 | 1.1-b1568 |



11 Comments
Jason Monsorno
Jul 16, 2013I'm trying to use the svn revision and svn branch name in the release name but can't get it to work. In a task I use ${bamboo.repository.revision.number} and ${bamboo.repository.branch.name} respectively and they work fine. Is there something I'm missing or some trick I can do to pull this information for the deployment release name?
Jason Monsorno
Jul 16, 2013${bamboo.planRepository.revision} and ${bamboo.planRepository.branchName} respectively seem to work. Found through the deployment log output.
EddieW
Sept 17, 2013Not true unfortunately. Build variables seem limited to the known bamboo ones, and not ones created by plugins.
David Ehringer
Sept 19, 2013I'm trying to understand this as well. Is this a bug in the documentation on this page?
James Dumay
Sept 23, 2013Hi Eddie,
Which plugins are you having issues with?
Thanks
James
EddieW
Sept 23, 2013Hi James Dumay - thanks for hopping in!
David Ehringer's excellent Maven Pom Extractor plugin created build level variables that we use to extract the post-release version of an artifact. (we still rely on maven to tag in svn and push to nexus)
https://marketplace.atlassian.com/plugins/com.davidehringer.atlassian.bamboo.maven.maven-pom-parser-plugin
Although hypothetically he could support plan level variables, it doesn't really make sense in the context of the plugins functionality (extract version info for a specific build)
James Dumay
Sept 23, 2013Thanks Eddie. We do not expose Job level variables to deployment projects as they might conflict when there are multiple jobs for each plan.
The POM parser plugin needs to set its variable on the plan level in order for this to work.
EddieW
Sept 24, 2013For clarification, there are 4 levels of variables?
Or are some of those synonymous?
Because changing from Job to Build would be fine I think, but Plan would not make sense.
Also the Inject Varibles plugin does not work either, https://answers.atlassian.com/questions/188531/error-running-inject-task-on-remote-agent
Is there any hack/workaround that we can do to set variables at the proper scope from a task?
David Ehringer
Sept 24, 2013I echo EddieW's question.
Maybe to help further frame the question, one of most common release naming schemes that I see people wanting to use is ${bamboo.maven.version}-${bamboo.buildNumber} (or similar variants). Based on my experimentation (which I could of messed up
), if you use Plan variables for the version, you aren't guaranteed to get the correct version since the variable is shared across instances of the Plan. So if you allow concurrent builds or use stages in your plan, your version number can get out of whack pretty easily.
NathanA
Sept 20, 2013Thanks for raising this issue guys. let me double check the documentation.
What plugin and variable are you trying to use? If we know this, then we can test our reply more fully.
NathanA
Sept 20, 2013I've raised an issue for a Bamboo Dev to check the relationships between Build and plugin variables.