This documentation relates to an earlier version of Bamboo.
View

Unknown macro: {spacejump}

or visit the current documentation home.

Triggering a build on code check-in has the advantage of placing minimal load on your Bamboo server, but requires that your source-code repository is configured to fire an event to the Bamboo server.

Step 1. Configure your source repository

  1. Configure your source-code repository to run post-commit scripts to tell Bamboo whenever a code commit has occurred.
    • For CVS, edit two files in the CVSROOT module: commitinfo and loginfo.
      • For commitinfo add a line like this:
        ^jira(/|$)  /pathto/preCommit.sh
        
        ここで、「jira」は自分のモジュールです。
      • For loginfo add a line like this:
        ^jira(/|$) /pathto/postCommitBuildTrigger.sh %{} http://bambooserver JIRA-MAIN JIRA-BRANCH
        
        ここで、JIRA-MAIN と JIRA-BRANCH はトリガーする Bamboo 計画、JIRA はプロジェクト キー、BRANCH または MAIN は計画キーです。
    • For Subversion, edit the Subversion respository's hooks/post-commit trigger file with something like:
      /pathto/postCommitBuildTrigger.sh http://bambooserver JIRA-MAIN JIRA-BRANCH
      
    • For Perforce, add the script as a change-commit trigger.
      triggerName change-commit //myDepot/... "/usr/local/bin/postCommitBuildTrigger.sh http://bambooServer/ MYPLAN-DEFAULT"
      
  2. Copy the scripts to your repository. If you are using Bamboo Standalone, the scripts are located in the /scripts folder of your Bamboo Installation Directory. If you are using Bamboo EAR-WAR you can find them in the /repositoryScripts folder. You can also download the scripts by following this link.
  3. リポジトリが実行されているオペレーティング システムによっては、スクリプトの編集が必要になることがあります。スクリプトは、「wget」が「/usr/bin/」にあると仮定します。これが自分のリポジトリに当てはまらない場合 (たとえば Solaris 10 では /usr/sfw/bin/ にある)、スクリプトを編集して、「/usr/bin/」を適切な場所に変更します。
  4. Bamboo を実行しているユーザーが、スクリプトを実行する適切なファイル権限を持っていることを確認します。つまり、スクリプトは非 root ユーザーでも実行可能でなければなりません。
  5. Enable Bamboo's remote API so that the scripts can use Bamboo's REST-style remote API to access Bamboo's data.


Step 2. Configure Bamboo to trigger a build on code check-in

Trigerring a build when there is no update

Bamboo will ignore the build triggers, if the local working copy and the repository copy have the same revision numbers. When testing your build triggers, please check that the local working copy is not the latest version - in which case, no further action will be taken.

  1. Click 'Home' to go to the Dashboard.
  2. Click the 'All Plans' tab.
  3. Locate the plan in the list and click this icon:
  4. The 'Configuration' tab will be displayed. Click the 'Source Repository' sub-tab.
  5. In the 'Build Strategy' field, select 'Repository triggers the build when changes are committed' (see screenshot below).
  6. This will display the 'Trigger IP Address' field. If you want Bamboo to receive post-commit notifications from the respository's primary IP address, leave the 'Trigger IP Address' field blank. If you want Bamboo to receive post-commit notifications from a different IP address, type the IP address in the 'Trigger IP Address' field.
  7. 保存」ボタンをクリックします。

Screenshot: 'Plan Configuration--Source Repository-Build Strategy: Repository triggers the build when changes are committed'