わかりました、私は自分で書きました。これは、Subversionのポーリングタイムアウトよりもはるかに優れています。テスト済み:
- VisualSvnサーバー2.7.2;
- Windows Web Server2008R2。
- PowerShell 2.0
BambooWebApiTrigger.bat
PowerShellのバッチファイルランナーC:\SvnHooks\
:
@echo OFF
rem this file just makes spawning powershell from VisualSvn a tad easier...
rem
rem Args from VisualSvn Server are ignored. Pass Bamboo BUILD KEY as the first
rem parameter to this script.
Powershell.exe -executionpolicy remotesigned -File C:\SvnHooks\BambooWebApiTrigger.ps1 -key %1
BambooWebApiTrigger.ps1
でもSystem.Net.WebClientを実行するためのPowerShellスクリプトC:\SvnHooks\
。ローカルのBambooサーバーでbamboo.yourdefaultdomain.comを上書きします。
# A Powershell script to trigger Bamboo to build a specific key
param (
[string]$baseurl = "http://bamboo.radicalsystems.com.au:8085",
[Parameter(Mandatory=$true)]
[string]$key,
[string]$tmp = $null
)
$fullUrl = $baseurl + "/updateAndBuild.action?buildKey=" + $key
if (!$tmp) {
$tmp = [io.path]::GetTempFileName()
}
echo "Pinging Bamboo API at '$fullUrl'"
$client = new-object System.Net.WebClient
$client.DownloadFile($fullUrl, $tmp)
# comment Remove-Item to see the results. It is a HTML result with success message.
# echo "Results are in $tmp"
Remove-Item $tmp
VisualSvnを構成する
VisualSvnサーバーマネージャー>プロパティ>フック>コミット後フック(編集)でプロジェクトを右クリックします。
他の後にこの行を入力してください:
C:\SvnHooks\BambooWebApiTrigger.bat BambooProjectKey
ここで、BambooProjectKeyはキーであり、ビルドプラン(プロジェクトではない)を参照するときにbambooURLの後にあります。通常、ハイフンが含まれていますhttp://bamboo.yourdomain.com:8085/browse/FOO-BAR
。この場合、FOO-BARが鍵になります。
Bambooを構成する
Bambooトリガーをリポジトリに変更すると、変更がコミットされたときにビルドがトリガーされます
オプション
VisualSvnのコミット後フックダイアログからキーを上書きしたり、バッチファイルランナーからBambooベースURLと一時ファイルの場所を上書きしたりできます。