2010-12-02 6 views
7

自動ビルド用にCruiseControl.NET 1.5.7256.1を設定しようとしています。私のプロジェクトはMercurialの中に保存されている、と私は次のようccnet.configを使用しています:Mercurialで動作するCruiseControl.NETを取得する方法:「ソースコントロールの失敗(GetModifications)」

<cruisecontrol xmlns:cb="urn:ccnet.config.builder"> 
    <project name="Slider" webURL="http://localhost/ccnet"> 
     <triggers> 
      <intervalTrigger seconds="3600" /> 
     </triggers> 
     <sourcecontrol type="hg" autoGetSource="true"> 
      <executable>C:\Python26\Scripts\hg.bat</executable> 
      <repo>c:\repos\slider</repo> 
      <workingDirectory>c:\ccnet\slider</workingDirectory> 
     </sourcecontrol> 
     <tasks> 
      <msbuild> 
       <executable>C:\Windows\Microsoft.NET\Framework64\v4.0.30319\msbuild.exe</executable> 
       <workingDirectory>c:\ccnet\slider</workingDirectory> 
       <projectFile>Slider.sln</projectFile> 
       <buildArgs>/noconsolelogger /p:Configuration=Debug /v:diag</buildArgs> 
       <targets>Slider</targets> 
       <timeout>900</timeout> 
       <logger>C:\Program Files (x86)\CruiseControl.NET\server\ThoughtWorks.CruiseControl.MsBuild.dll</logger> 
      </msbuild> 
     </tasks> 
    </project> 
</cruisecontrol> 

しかし、私は、ビルドを強制するとき、私はこのエラーを取得する:

[Slider:WARN] Source control failure (GetModifications): Source control operation failed: < was unexpected at this time. 
. Process command: C:\Python26\Scripts\hg.bat log -r 0:123 --template <modification><node>{node|short}</node><author>{author|user}</author><date>{date|rfc822date}</date><desc>{desc|escape}</desc><rev>{rev}</rev><email>{author|email|obfuscate}</email><files>{files}</files></modification> --noninteractive 
[Slider:INFO] Integration complete: Exception - 12/2/2010 1:19:08 PM 

エラーはおそらく引用符で囲まれていないによって引き起こされます--templateパラメータの角カッコを使用することができますが、CC.NETでそのパラメータの前後に引用符を付けるにはどうすればよいですか?からインストール

@echo off 
rem Windows Driver script for Mercurial 

setlocal 
set HG=%~f0 

rem Use a full path to Python (relative to this script) as the standard Python 
rem install does not put python.exe on the PATH... 
rem %~dp0 is the directory of this script 

%~dp0..\python "%~dp0hg" %* 
endlocal 
+0

hg.batの内容はどのように見えますか? – bluevoodoo1

+0

Hgを実行するためにPythonインタプリタを呼び出します。 IIRCはPythonパッケージインストーラによって作成されました。私は月曜日に内容を掲載することができます。 –

+1

さて、Hgでうまく動作し、設定も簡単なTeamCityに切り替わりました。 CC.NETで何がうまくいかなかったのかを知ることは素晴らしいことです。 –

答えて

3

私が正常にMercurialのでCruiseControl.NET 1.5.7256.1を使用しています:

===============

ここhg.batですこのmsiは、の値としてhg.exeのフルパスを使用しています。

project\core\sourcecontrol\Mercurial\Mercurial.csでテンプレートは次のように使用されている:

buffer.AddArgument("--template", HistoryTemplate) 

このようなコマンドライン用にフォーマットされます

セパレータは " "あり、 AutoDoubleQuoteStringテンプレートを引用します
string.Format("{0}{1}{2}", arg, separator, StringUtil.AutoDoubleQuoteString(value)) 

、これはエラーの原因ではありません。

UPDATE 1

は実際には、AutoDoubleQuoteStringは、テンプレートを引用する必要がありますが、現在のバージョンでそれを行うことはありません。また、hg.exeを使用してビルドが成功した場合でも、コマンドプロンプトで実際のコマンドラインを実行すると、同じエラーが返されます。

CruiseControl.NET 1.6.7981.1 2がちょうどリリースされたUPDATE(release notesを参照)、およびテンプレートは、現在のファイルとして渡されているので、それだけで正常に動作します(少なくとも私のPC上)。

+0

ああ、うーん。私はHgをインストールした方法でなければなりません。 –

関連する問題