This documentation relates to an earlier version of Bamboo.
View

Unknown macro: {spacejump}

or visit the current documentation home.

The instructions on this page describe how to configure a Git source repository.

On this page:

Configuring a Git Source Repository

Navigate to the source repository settings for a Plan or Job, as described on Specifying the Source Repository for a Plan. Choose to add a new or edit an existing repository and select Git in the Source Control drop-down. 

Git gives you the following options:

リポジトリ URL

The full path to your Git repository (eg: git://github.org/atlassian/bamboo-git-plugin.git)

有効な URL の形式は次のとおりです。

  • git://host.xz[:port]/path/to/repo.git
  • ssh://[user@]host.xz[:port]/path/to/repo.git
  • [user@]host.xz:path/to/repo.git
  • http[s]://host.xz[:port]/path/to/repo.git
  • /path/to/repo.git
  • file:///path/to/repo.git 
ブランチ  作業する関連ブランチ (またはタグ) の名前を入力します。master ブランチで作業する場合は、空のままにします。
認証タイプなしChoose none if you want to access the repository anonymously.
パスワードAuthenticate with a username and password.
SSH private key

Upload a private key and provide the corresponding SSH Passphrase.

Use shallow clones (shallow clone を使用する)

Bamboo で shallow clone を実行できるようにします (つまり、履歴は指定のリビジョン数に切り捨てられます)。これにより、最初のコード チェックアウトの速度が向上するはずですが、ビルドがリポジトリ全体の履歴に依存している場合は、このオプションを使用しないことをお勧めします。shallow clone は既定で有効になっています。

POM ファイルの場所

(上記で定義した) Git の [Repository URL (リポジトリ URL)] のルートを基準にしたプロジェクトの pom.xml ファイルのパスです。

(Maven 2 プロジェクトをインポートする場合にのみ利用可能) 


Common Repository Configuration

Force Clean Build (クリーン ビルドを強制)You can force Bamboo to remove the source directory and check it out again prior to the Plan/Job build being built by selecting this option. Please note that this will greatly increase the time it takes to complete a build.
Clean working directory after each buildYou can force Bamboo to remove the source directory after the Plan/Job is completed building by selecting this option. Please note that this may increase build times but saves on disk space.
Include/Exclude Files (ファイルを含める/除外する)You can specify a particular inclusion or exclusion pattern for file changes to be detected. If you select an option other than 'None', the following field will appear:

File Pattern — The regular expression for file changes which you wish to include/exclude. The regex pattern must match the file path in the repository.

Visit sub page for a few examples.

Web リポジトリ

一般的な Web リポジトリ

Web Repository URL — If your source repository can be accessed via a web browser, you can specify the URL of the source repository here. If you specify a Web Repository URL, then links to relevant files will be displayed in the 'Code Changes' section of a build result.

Web Repository Module — The repository name of the Plan/Job, if the above Web Repository URL points to multiple repositories.

Mercurial Web RepositoryChoose between using the BitBucket Web Repository Scheme (if you use BitBucket) or Mercurial's own default web server Default Web Repository Scheme (hgserve).
FishEye

FishEye URL — The URL of your FishEye repository (e.g. 'https://atlaseye.atlassian.com/').

Repository Name — The name of your FishEye repository (e.g. 'Bamboo'). This is effectively the alias for your repository path.

Repository Path — The path for your FishEye repository (e.g. '/atlassian/bamboo/').

リポジトリのパスを特定する方法

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. trunk)). For example, if a code change listed /atlassian/bamboo/trunk/bamboo-acceptance-test/pom.xml, the path would be /atlassian/bamboo/.
If you have not previously run builds with changes from your repository, you will need to ask your FishEye administrator for the repository path indexed by FishEye.

 
Build Strategy

Choose one of the build strategy options (listed below), which will be used for triggering the execution of this Plan. You can change the Build Strategy at a later point in time as required.

(warning) You may need to configure other options specific to your chosen build strategy.

(warning) If you select Manual & dependent builds only when creating a new Plan, an initial build will not automatically be run. You can force an initial build to be executed automatically by adding the fire.initial.build.for.manual.strategy to your bamboo.cfg.xml file as described in Configuring System Properties.


Screenshot: Source Repository — Git

注意

関連トピック

Specifying the Source Repository for a Plan
Specifying the Source Repository for a Job

  • ラベルなし

5 Comments

  1. Piotr Piątkowski

    What about triggers for git? Didn't find anything in documentation - table with "Build strategies" looks like copied from documentation for Subversion, not a word regarding git there.

    1. PiotrA

      Er, what do you mean by 'triggers for git'? What kind of information you need which the above documentation lacks?

      1. Piotr Piątkowski

        I need information how to configure git, to automatically trigger bamboo build after each push. Second option in "build strategies" table - there's a link to this page: http://confluence.atlassian.com/display/BAMBOO/Repository+Triggers+the+Build+when+Changes+are+Committed, but nothing about git can be found there.

        1. PiotrA

          I'd say you need to:

          • add post-receive script to your git repository. For example my .git/hooks/post-receive looks like:
            #!/bin/sh
            wget --bind-address=127.0.0.1 http://localhost:8085/bamboo/updateAndBuild.action?buildKey=HOOK-HOOK -O /dev/null
            
            (where http://localhost:8085/bamboo is my Bamboo basedir, and HOOK-HOOK is the project-plan key for the plan using Git Repository)
          • you might need to tweak Trigger IP Address (Bamboo->Plan->Repository Configuration page). For example I had to change it to:
            127.0.0.1
            

          And that should do the trick. Does it help?

          1. Piotr Piątkowski

            Yes, Piotr, I see that you added info to the page about Git configuration too, and that's exactly what I was asking for - thank you.