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

Unknown macro: {spacejump}

of Bamboo, or visit the latest Bamboo documentation.

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 サーバーが他のオペレーティング システムで動作している場合は、以下のスクリプト ファイルと (必要に応じて) コマンドをそのオペレーティング システムに合わせて変更する必要があります。

ステップ 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

ここで:

  • base-url は Bamboo サーバーのベース URL です。例:

    http://<name-of-machine>:8085
  • 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 によって拒否されます。

  • ラベルなし