Bamboo が提供する幅広いオプションを利用すると、リリースの命名スキームを制御できます。Bamboo によるリリース バージョニングの処理方法を指定し、リリース間の自動インクリメントを制御できます。

Bamboo では、以下の機能を利用できます。

  • シンプルなインクリメント採番 
  • Bamboo 変数に基づく高度な採番

Bamboo では、新しいリリースを作成するときに、自動リリース設定を手動で上書きすることもできます。

On this page:

シンプルなリリース バージョニング

シンプルなリリース バージョニングでは、リリースの開始番号(例えば、1.0)を指定できます。Bamboo はこの番号から自動的にインクリメントします。シンプルなリリース バージョニングを使用する場合、Bamboo はリリース名に含まれる最後の番号をインクリメントします。次に例を示します。

リリース名インクリメントされたリリース名
12
1.11.2
1.111.12
1.0.11.0.2

 

シンプルなリリースの命名を設定する方法

  1. 「デプロイ プロジェクトの設定」画面の [Release versioning(リリース バージョニング)] ボタンをクリックして、「リリース バージョニング」画面を表示します。

  2. 次のフィールドを使用して、「リリース バージョニング」画面の入力を完了します。

    フィールド
    説明
    Optional?
    Create release name(リリース名の作成)Bamboo が作成する次のリリース名の識別情報。シンプルなリリースの命名では、1.0 のような分かりやすいものを使用する必要があります。(error)
    Automatically increment with each new release(新しいリリースごとに、自動的にインクリメント)[Numbers(番号)] チェックボックスをオンにすると、前述した [Next release name(次のリリース名)] フィールドに従ってリリース番号が自動的にインクリメントされます。このチェックボックスをオフのままにしておくと、リリース番号はインクリメントされません。(tick)
    プレビュー

    このフィールドでは、次のリリース名がどのようになるかをプレビューできます。プレビューを表示するには、[Create release name(リリース名の作成)] フィールドの横にある [プレビューを生成] ボタンをクリックします。

    注意: 場合によっては、プレビューを利用できないことがあります。

    -
  3. [保存] ボタンをクリックして変更を保存します。

変数を使用したリリース バージョニング

変数を使用したリリース バージョニングでは、Bamboo 内で設定された変数に基づいて、より複雑な命名スキームを作成できます。リリース スキーム内では、グローバル変数、プラン変数、およびビルド変数を使用できます。

「m6」という値を持つプラン変数「planvar」があるとします。この変数キーを [Next release name(次のリリース名)] フィールドに含めることで、Bamboo は変数値を次のリリース名に自動的に追加し、適宜インクリメントしていきます。

変数キー変数の値次のリリース名次のリリース後続のリリース
planvarm61.0-${bamboo.planvar}1.0-m61.1-m7


変数を使用したリリースの命名を設定する方法

  1. Click the Release versioning button on the 'Deployment project configuration' screen to display the 'Release naming' screen:
  2. 次のデータを使用して、[Create release name(リリース名の作成)] フィールドを入力します。

    フィールド
    説明
    Optional?
    バージョンBamboo が作成する次のリリース名の識別情報。シンプルなリリース バージョニングでは、1.0 のような分かりやすいものを使用する必要があります。(error)
  3. Click on the Add variable to release name link to display the Variables selection screen:
  4. [変数を追加] をクリックして、変数をリリースの命名スキームに含めます。[閉じる] をクリックして「リリースの命名」画面に戻ります。
  5. 次のフィールドを使用して、[リリース名] フィールドを入力します。

    フィールド
    説明
    Optional?
    Automatically increment with each new release(新しいリリースごとに、自動的にインクリメント)1. [Numbers(番号)] チェックボックスをオンにすると、前述した [Next release name(次のリリース名)] フィールドに従ってリリース番号が自動的にインクリメントされます。このチェックボックスをオフのままにしておくと、リリース番号はインクリメントされません。
    2.リリース番号の自動インクリメントのプランに任意の変数を含めるには、[変数] チェックボックスをオンにします。
    (tick)
    プレビュー

    このフィールドでは、次のリリース名がどのようになるかをプレビューできます。プレビューを表示するには、[Create release name(リリース名の作成)] フィールドの横にある [プレビューを生成] ボタンをクリックします。

    注意: 場合によっては、プレビューを利用できないことがあります。

    -
  6. [保存] ボタンをクリックして変更を保存します。

リリース バージョニングのスキーム例

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(error)(error)-1.01.0
本質的に一意の変数1.0-${bamboo.buildNumber}(error)(error)131.0 ~ 131.0 ~ 13
番号のインクリメント1.0(tick)(error)-1.01.1
番号のインクリメント + 固定変数1.0-${bamboo.appName}(tick)(error)

${bamboo.appName}

プランまたはグローバル変数: Awesome

1.0-Awesome1.1-Awesome
変数のインクリメント1.0-${bamboo.milestone}(error)(tick)

${bamboo.milestone}

プランまたはグローバル変数: m6

1.0-m61.0-m7
番号と変数のインクリメント1.0-b${bamboo.appNumber}(tick)(tick)

${bamboo.appNumber}

ユーザー定義変数: 1567

1.0-b15671.1-b1568
  • ラベルなし

11 Comments

  1. Jason Monsorno

    I'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?

    1. Jason Monsorno

      ${bamboo.planRepository.revision} and ${bamboo.planRepository.branchName} respectively seem to work. Found through the deployment log output.

  2. EddieW

    You can use global, plan and build variables in your releasing scheme.

    Not true unfortunately. Build variables seem limited to the known bamboo ones, and not ones created by plugins.

    1. David Ehringer

      I'm trying to understand this as well.  Is this a bug in the documentation on this page?

    2. James Dumay

      Hi Eddie,

      Which plugins are you having issues with?

      Thanks
      James 

      1. EddieW

        Hi 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)

        1. James Dumay

          Thanks 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.

          1. EddieW

            For clarification, there are 4 levels of variables?

            1. job
            2. build
            3. plan
            4. global

            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

            Could not execute task 'Inject version' no Plugin with key 'com.atlassian.bamboo.plugins.bamboo-variable-inject-plugin:inject' is installed.

             

            Is there any hack/workaround that we can do to set variables at the proper scope from a task?

             

          2. David Ehringer

            I 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 (smile) ), 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.

  3. NathanA

    Thanks 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.

  4. NathanA

    I've raised an issue for a Bamboo Dev to check the relationships between Build and plugin variables.