This is the documentation for Bamboo 5.8. View this page for the

Unknown macro: {spacejump}

of Bamboo, or visit the latest Bamboo documentation.

計画ブランチは、バージョン管理リポジトリ内のブランチを表すために使用します。計画ブランチでは、計画と同じビルド設定が使用されます。

Tools such as Git and Mercurial encourage a practice called feature branching, where a developer can use a new branch to work in isolation from his or her team members before merging their changes back into main line development. Previously however, changes made on a branch may not have been built and tested by Bamboo unless the developer had specifically set up a new build plan, or had cloned an existing plan and configured it to build the new branch.

現在では、Bamboo で計画ブランチを使用できるため、

  • リポジトリで新規作成されたブランチは、親計画と同じビルド設定を使用して自動でビルドおよびテストされます。 
  • 必要に応じて、親計画を上書きしてブランチ計画を個別に設定できる柔軟性があります。
  • オプションで、ビルドが成功した場合にフィーチャー ブランチからの変更を「master」(トランク ブランチ、既定のブランチ、メインライン ブランチなど) に自動でマージすることもできます。

計画のブランチングを有効化する

Bamboo で計画のブランチングを有効化すると、ソース リポジトリのブランチが作成されるたびに自動で計画ブランチが作成されます。計画ブランチを手動で作成することもできます。

You can override the master plan's configuration in a branch plan, if required.

計画のブランチのリストを表示するには、ダッシュボードの [すべての計画] タブの計画名の横にあるブランチ アイコンをクリックします。リストからブランチ名を選択すると、そのブランチ計画の要約ページに直接移動します。

スクリーンショット: ブランチの [Plan Summary (計画の要約)] ページに「ブランチ」メニューが表示されている。


自動ブランチング

You can use auto branching for Git, Mercurial and Subversion repositories. For other repository types, you can use manual branching.

Bamboo でリポジトリのブランチが作成されるたびに自動で計画ブランチを管理するには、次の手順を実行します。

  1. ブランチを作成する計画の設定ページの [ブランチ] タブに移動します。
  2. [Create plan branches for branches detected in the repository (リポジトリで検出されたブランチの計画ブランチを作成する)] チェックボックスをオンにします。
  3. Enter a regular expression to match the repository branch names for which plan branches will be created. An example is: (branch1|branch2|branch3)/.* See the Java documentation on regular expressions.
  4. Make the following optional settings as required. These will be applied to all branch plans created from this plan configuration, although they can be overridden in those branch plans, if required.

    マージ
    Not available for Subversion.
    Check Branch merging enabled, and complete either the 'Branch updater' or 'Gatekeeper' sections, as described below.
    Jira フィーチャー ブランチCheck Create remote links from JIRA issues... to have the plan branch automatically linked, using an issue key in the branch name. Described below.
    通知Described below.
    計画ブランチのクリーンアップ[Remove after (削除までの日数)] の値 (日数) を編集します。この期間内に VCS ブランチへのコミットが行われなかった場合、ブランチは自動で削除されます。値がゼロの場合、計画は削除されません。
    ブランチのルート

    Subversion ソース リポジトリを使用する計画でのみ利用可能です。Bamboo では、Subversion リポジトリの構造がブランチの規則に従っていると仮定して、ブランチのルート URL が自動で計算されます。

    たとえば、 https://svn.mycompany.com/svn/fastBuild/trunk という URL を持つ fastBuild リポジトリの場合、Bamboo では https://svn.mycompany.com/svn/fastBuild/branches という場所にブランチが作成されることを想定します。

    Subversion リポジトリの構造が別の規則に従っている場合は、[Change branch root URL (ブランチのルート URL を変更)] を選択して、リポジトリ ブランチの作成場所を指定できます。

  5. 保存をクリックします。

ブランチ検出

計画のブランチングを有効にすると、Bamboo では既定で 300 秒ごとに新しいブランチがチェックされます。ブランチの検出間隔は次のようにしてカスタマイズできます。

  1. Click the  icon in the Bamboo header and choose Overview.
  2. 左側のナビゲーションパネル ([システム] の下) の [一般設定] をクリックします。
  3. [Branch detection interval (ブランチの検出間隔)] に新しい値 (秒単位) を入力します。
  4. 保存をクリックします。

手動ブランチング

Use manual branching for all supported repository types. You may want to consider using auto branching for Git, Mercurial and Subversion repositories.

計画のブランチを手動で作成するには、次の手順を実行します。

  1. ブランチを作成する計画の設定ページの [ブランチ] タブに移動します。
  2. [ブランチを作成] をクリックします。Bamboo では、計画の指定されたリポジトリ内のブランチが自動でチェックされます。
  3. 利用可能な VCS ブランチから選択して、[作成] をクリックします。
  4. You can override the default settings for the branch, such as the source repository used, if you wish.

ブランチを Jira と統合する

開発者は、Jira 課題に記述されている機能の開発を始める際に、Git や Mercurial を使用してリポジトリのブランチを作成します。課題キーを VCS ブランチ名の一部として使用すると、Bamboo によって課題キーが検出され、新しいブランチが自動で課題にリンクされます。

  • ブランチ名に Jira 課題キーが含まれている必要があります。「jb-BDEV-790」や「BDEV-769 1」は有効な形式です。
  • このリンクは、計画ブランチの [Build Result Summary (ビルド結果の要約)] のブレッドクラムのすぐ下に表示され、Jira 課題にも表示されます。

To use JIRA Feature Branching, Bamboo needs an application link to the JIRA server.

 

ブランチの通知

master 計画の場合と同じように、ブランチ計画からビルド通知を受け取ることができます。

計画から作成されたすべてのブランチによる通知の送信方法を指定するには、計画の設定の [ブランチ] タブに移動して、次のいずれかのオプションを選択します。

  • Notify committers and people who have favourited this branch.
  • 計画の通知設定を使用する。
  • このブランチでは通知を送信しない。

You can override how notifications are sent from a particular branch plan, if necessary, by going to the Notifications tab on the Plan Branch configuration.

See Configuring notifications for a plan and its jobs for information about plan notifications.

ブランチの依存関係

You can use build dependencies for plan branches in a similar way to that for plans: a branch plan is triggered only when another branch plan has been successfully built. This can be used to ensure that breaking source code changes associated with one branch plan are detected before they can break the build of a dependent branch plan. Dependencies between master plans are maintained if their branch plans have the same name. See Setting up plan build dependencies for further information about dependencies.

Select Enable dependencies for all branches of this plan, on the Dependencies tab for the plan configuration, if you want plan branches to honour the build dependencies of their respective master plans.

計画ブランチの設定

計画ブランチの作成が自動か手動かにかかわらず、master 計画はそのブランチ計画の構造と構成を管理します。ただし、設定ページに移動して、ブランチ計画の次の設定を上書きすることはできます。

Branch clean-up (ブランチのクリーンアップ)

ブランチの設定の [ブランチの詳細] タブで、計画ブランチが自動でクリーンアップされないように指定できます。

(info) 自動ブランチ クリーンアップは Mercurial、Git (Bamboo 4.1.1 以降)、および Subversion (Bamboo 4.2.0 以降) でサポートされていることにご注意ください。

トリガーのタイプ

On the Branch details tab of the branch's configuration. See Triggering builds.

1 つの計画ブランチに設定できるトリガーは 1 つだけであり、これは master 計画に設定されるすべてのトリガーよりも優先されることにご注意ください。

マージ
On the Branch details tab of the branch's configuration. Described below.
ソース リポジトリOn the Source repository tab of the branch's configuration. See Linking to source code repositories.
通知

ブランチの設定の [通知] タブにあります。オプションは次のとおりです。

  • Notify committers and people who have favourited this branch.
  • 計画の通知設定を使用する。
  • このブランチでは通知を送信しない。

See Configuring notifications for a plan and its jobs for information about plan notifications.

VariablesOn the Variables tab of the branch's configuration. See Defining plan variables.

自動マージの使用

ブランチのマージを自動化する場合、Bamboo には 2 つのマージ モデルが用意されています。

  • ブランチ アップデーター - ブランチ リポジトリが master の変更に応じて最新の状態に保たれます。
  • ゲートキーパー - 正常にビルドされたブランチが変更された場合にのみ、既定のリポジトリが更新されます。

The automatic branch merge strategy for the master plan can be overridden in an individual plan branch, if required.

 

ブランチ アップデーター

使用環境

ブランチ アップデーターは、次のような場合に使用してください。

  • フィーチャー ブランチを構築する前に、チームの master ブランチからフィーチャー ブランチに自動でマージします。オプションで、ビルドが成功した場合に master に再マージします。
  • フィーチャー ブランチの変更がチームの master ブランチに対応しなくなった際に通知を受け取ります。

設定

別のリポジトリの最近の変更をブランチ リポジトリに統合するには、次の手順を実行します。

  1. ブランチ計画の設定ページの [ブランチの詳細] タブに移動します。
    ([すべての計画] タブで計画名の横にあるブランチ アイコンをクリックして、[アクション] > [ブランチを設定] を選択します。)
  2. [マージ] で [Branch Merging Enabled (ブランチ マージが有効)] を選択して、[ブランチ アップデーター] をクリックします。
  3. [Merge From (マージ元)] リストを使用して、フィーチャー ブランチにマージする変更が行われるリポジトリを選択します。
  4. [成功時にプッシュ] は、ビルドが正常に完了した後で変更をブランチに再マージする場合にのみ選択します。
  5. 保存をクリックします。

Gatekeeper

使用環境

ゲートキーパーは、次のような場合に使用してください。

  • 両方のブランチからマージされた変更が正常にビルドされた後、フィーチャー ブランチをチームの master ブランチに自動でマージします。
  • 両方のブランチから結合された変更のビルドが失敗した際に通知を受け取り、フィーチャー ブランチがチームの master ブランチに再マージされないようにします。

設定

正常にビルドされた変更を別のリポジトリにプッシュするには、次の手順を実行します。

  1. ブランチ計画の設定ページの [ブランチの詳細] タブに移動します。
    ([すべての計画] タブで計画名の横にあるブランチ アイコンをクリックして、[アクション] > [ブランチを設定] を選択します。)
  2. [マージ] で [Branch Merging Enabled (ブランチ マージが有効)] を選択して、[ゲートキーパー] をクリックします。
  3. [チェックアウト] リストを使用して、変更をマージする (同時に変更のプッシュ先となる) リポジトリを選択します。
  4. [成功時にプッシュ] は、ビルドが正常に完了した後で変更を他のリポジトリにプッシュする場合にのみ選択します。
  5. 保存をクリックします。

計画ブランチの制限事項

計画の自動ブランチングおよびマージには、次の制限が適用されます。

操作制限事項
計画の自動ブランチング
  • Git、Mercurial、および Subversion リポジトリでのみ使用できます。他のリポジトリ タイプでは、手動ブランチングを使用してください。
  • Cannot be used with the Git implementation embedded in Bamboo. (You need to have set up native Git.)

計画の手動ブランチング

  • Bamboo でサポートされているすべてのリポジトリ タイプで使用できます。
ブランチの自動マージ
  • Git および Mercurial リポジトリでのみ使用できます。
  • Bamboo で設定されたブランチでのみ使用できます。
  • Cannot be used with the Git implementation embedded in Bamboo. (You need to have set up native Git.)

ブランチ ウォールボード

ブランチ ウォールボードには、すべてのブランチのステータスと各ブランチが属する計画が表示されます。計画自体のステータスが常に最初に表示されます。灰色で表示される計画は無効になっています。

ブランチ ウォールボードを表示するには、次の手順を実行します。

  1. 表示するブランチがある計画の [Plan Summary (計画の要約)] に移動します。
  2. [アクション] > [ブランチ ウォールボード] を選択します。

  • ラベルなし