This page provides instructions on how to configure Subversion to send message events that trigger the execution of Bamboo plans. You only need to configure Subversion to send these message events if The repository triggers the build when changes are committed build strategy has been specified for one or more of your Bamboo plans.
ビルドをトリガーするように Subversion を設定する
このセクションでは、リポジトリが変更されたときにビルドをトリガーするように Subversion を設定する方法について説明します。Subversion リポジトリが変更されるたびに、Subversion のフック スクリプトを使用してトリガー アクションが実行されます。
次のコマンドとスクリプト ファイルでは、Subversion サーバーが UNIX または Linux ベースのオペレーティング システムで動作していることを想定しています。Subversion サーバーが他のオペレーティング システムで動作している場合は、以下のスクリプト ファイルと (必要に応じて) コマンドをそのオペレーティング システムに合わせて変更する必要があります。
On this page:
関連ページ
ステップ 1: Subversion の post-commit フックを有効にする
これを行うには、次のコマンドを実行します。
cd svn-repository-containing-the-build-source-code cd into the hooks/ directory
Subversion の post-commit ファイルは、既定ではインストールされていません。存在しない場合は、post-commit.tmpl ファイルを hooks/ ディレクトリにコピーし、名前を post-commit に変更して実行可能にします。
cp post-commit.tmpl post-commit chmod a+rx post-commit
ステップ 2: post-commit トリガーをインストールする
Bamboo のビルド トリガー スクリプト ファイルを実行するため、post-commit ファイルに次のような行を追加します。
/path-to-your-bamboo-installation/scripts/svn-triggers/postCommitBuildTrigger.sh base-url BUILD-KEY
ここで:
http://<name-of-machine>:8085base-urlは Bamboo サーバーのベース URL です。例:BUILD-KEYは、実行する Bamboo プランのキーです。
(chmod を使用して) Bamboo のビルド トリガー スクリプト ファイルを実行可能にして、Subversion ユーザーが実行できるようにします。
ステップ 3: テスト コミットを行う
「テスト」コミットを行います。数秒後、Bamboo によって関連プランの作成が開始されます。
Bamboo のログ ファイルには、次のようなエントリが含まれているはずです。
[INFO] com.atlassian.bamboo.build.UpdateAndBuild - Bamboo build was triggered by remote http call from 127.0.0.1
注意
ビルド トリガーのセキュリティ - Bamboo では、いずれかの Bamboo プランの Subversion リポジトリ URL で特定される Subversion サーバーでトリガーが発生した場合にのみ、リモート ビルド トリガーが許可されます。他の Subversion サーバーで発生したリクエストは、Bamboo によって拒否されます。
4 Comments
John Crim
Dec 09, 2010It seems ridiculous to me to only support triggering a single build plan in your post-commit hook. Over 2 years ago, I opened an issue to support multiplexing build triggers to multiple build plans. Triggering is preferable to polling b/c it's much more efficient, resulting in reduced load on your source control system. Unfortunately the current trigger implementation is not viable for anything but the most trivial implementation.
If you think multiplexing build plans is a good idea, please vote for http://jira.atlassian.com/browse/BAM-3017 .
Jay Gao
Aug 11, 2011Can we only apply the trigger to the specific subversion branch?
Anonymous
Jun 10, 2013The 'postCommitBuildTrigger.sh' doesn't exist in Bamboo's windows installation...
where can I found it?!
Avi
Jun 10, 2013The 'postCommitBuildTrigger.sh' doesn't exist in Bamboo's windows installation...
where can I found it?!