Git
This page describes how to configure Bamboo to use a Git repository.
Bamboo では、次のレベルでリポジトリを指定できます。
- グローバル - Bamboo のすべてのプランでリポジトリを利用できます。
- プラン - Bamboo プランのすべてのジョブでリポジトリを利用できます。
- ジョブ - Bamboo ジョブのすべてのタスクでリポジトリを利用できます。
推奨されるアプローチは、リンクされたソース リポジトリをグローバル レベルで設定することです。「ソース コード リポジトリへのリンク」を参照してください。
You need to have previously defined a Git capability before you can configure a Git source repository – see Defining a new version control capability.
Bamboo には独自の Git 実装が組み込まれていることに注意してください。ただし、シンボリック リンク、サブモジュール、自動ブランチ検出、自動マージを使用するには、ネイティブ Git を使用する必要があります。これらは組み込みの Git ではサポートされていません。
Git は次の場所からダウンロードできます。
Git ソース リポジトリを設定する
- リンクされたリポジトリ、プラン、またはジョブのポジトリ設定に移動します。「ソース コード リポジトリへのリンク」を参照してください。
- Either click Add Repository to add a new repository, or edit an existing repository configuration.
- Choose Git from the Source Repository list.
- Enter a Name to help identify the repository in Bamboo.
- プランの Git ソース リポジトリ用に次の設定を指定できます。
リポジトリ URL | The full path to your Git repository (eg: https://bitbucket.org/atlassian/bamboo-git-plugin.git ) 有効な URL の形式は次のとおりです。
| |
ブランチ | Type the name of the relevant branch (or tag) you want to work on. Leave empty to work on the master branch. | |
認証タイプ | None – choose if you want to access the repository anonymously | |
Username and password – use shared credentials or type a username and a password | ||
SSH private key – use shared credentials or upload an SSH key and provide the SSH passphrase | ||
Use shallow clones (shallow clone を使用する) | Bamboo で shallow clone を実行できるようにします (つまり、履歴は指定のリビジョン数に切り捨てられます)。これにより、最初のコード チェックアウトの速度が向上するはずですが、ビルドがリポジトリ全体の履歴に依存している場合は、このオプションを使用しないことをお勧めします。shallow clone は既定で有効になっています。 | |
POM ファイルの場所 | (上記で定義した) Git の [Repository URL (リポジトリ URL)] のルートを基準にしたプロジェクトの (Maven 2 プロジェクトをインポートする場合にのみ利用可能) | |
Git LFS |
詳細オプション
サブモジュールを使用する | リポジトリにサブモジュールが定義されている場合に、サブモジュールのサポートを有効にするために選択します。エージェントにネイティブの Git 機能が定義されていない場合、サブモジュールのサポートは無効になります。 |
---|---|
コマンド タイムアウト | これは、ハングした Bitbucket プロセスを停止するのに役立ちます。低速なネットワークでは、Bamboo が Git リポジトリの最初の複製を作成する時間を確保するため、既定のタイムアウトを長くすることを検討してください。 |
詳細なログ | Git コマンドからのより詳細なログを有効にします。Bamboo で Git に関する問題が発生した場合は、このオプションを使用してください。 |
Enable Quiet Period (待機期間を有効にする) | 1 つのコミットが検出されてからビルドが開始されるまでの遅延を指定します。これによって、複数のコミットを 1 つのビルドに集約できます。 |
Include/Exclude Files (ファイルを含める/除外する) | Allows you to specify the files that Bamboo should, or should not, use to detect changes. When you configure the Include option, it means that you want Bamboo to use only the mentioned files for change detection because by default Bamboo checks all the files. The same way, if you configure the Exclude option, Bamboo will not consider the excluded files for detecting changes. Enter into File Pattern a regular expression to match the files that Bamboo includes or excludes. The regex pattern must match the file path in the repository. See sub page for examples. |
Exclude Changesets (チェンジセットを除外) | Enter a regular expression to match the commit messages for changesets that should not start a build. |
Git LFS |
Web repository
Web リポジトリ | Web ブラウザでリポジトリを表示できる場合は、リポジトリの種類を選択します。 これによって、関連するファイルへのリンクをビルド結果の [コード変更] セクションに表示できます。 |
Stash – specify the following details for the repository:
See Integrating Bamboo with Bitbucket Server for more information. | |
Fisheye – specify the URL and other details for the repository:
See Integrating Bamboo with Fisheye for more information. リポジトリのパスを特定する方法 If you have previously run builds with changes from your repository, the easiest way of determining your repository path is to view the code changes and copy the path from the start of the path of one of the changed files, up to (but not including) the appropriate root directory. The root directories for repositories are the ones shown by Fisheye when browsing a repository (e.g. |