views:

324

answers:

1

We have an SVN repository hosted externally and our build server is currently internal. Occasionally (probably 1 or 2 times a day) the build server is unable to find the SVN repository due to a network outage, a timeout or some other random reason. With an externally hosted repository this is hard to avoid, however when it fails to find the SVN repository it fails the build!

I would like to find a way for it to just try again at the next interval and ignore any errors relating to an unfound repository. Does anyone know how I can do this?

I have posted my config for reference below.

<project name="MyProject" queuePriority="0">
<workingDirectory>C:\RemovedForPost</workingDirectory>
<artifactDirectory>C:\RemovedForPost </artifactDirectory>
<sourcecontrol type="svn">
  <trunkUrl>http://RemovedForPost \</trunkUrl>
  <workingDirectory>source</workingDirectory>
  <username>myuser</username>
  <password>*****</password>
</sourcecontrol>
<triggers>
  <intervalTrigger name="BuildAMinute" seconds="60" buildCondition="IfModificationExists" />
</triggers>
<tasks>
  <msbuild>
    <executable>C:\Windows\Microsoft.NET\Framework\v3.5\MSBuild.exe</executable>
    <workingDirectory>C:\RemovedForPost</workingDirectory>
    <projectFile>C:\RemovedForPost\RemovedForPost.sln</projectFile>
    <buildArgs>/noconsolelogger /p:Configuration=Debug /v:diag</buildArgs>
    <targets>Build</targets>
    <logger>C:\Program Files\CruiseControl.NET\server\ThoughtWorks.CruiseControl.MsBuild.dll</logger>
    <timeout>120</timeout>
  </msbuild>
  <nunit>
    <path>C:\Program Files\NUnit 2.5\bin\net-2.0\nunit-console.exe</path>
    <outputfile>C:\RemovedForPost.xml</outputfile>
    <assemblies>
      <assembly> RemovedForPost </assembly>
    </assemblies>
    <timeout>60</timeout>
  </nunit>
</tasks>

Thanks

+4  A: 

Correction. All of what you want is in the new settings

CruiseControl.NET docs

You can set it to not report a failure until max retries is set. So make max at 3 and set it to only move onto the publisher (ie fail the build) unit it hits the limit. So 1 or 2 misses will be ok, but then 3 fail the build something is wrong.

Alex
Well it would fail only once 95% of the times, only twice in a row the other 5% so that trigger isn't going to be much use to me, but if I can't fix this I'll have to get rid of CC.NET. With only 1-2 checkins a day we are getting a 50% build fail rate.
Odd
Well, I don't know where you would go. It would seem to be to be a basic priniciple of continuosu integration that if you cant reach the source control server you should fail the build. Is there a system you are thinking of that lets you configure this?
Alex
But if you are having THAT many failures, don't you think you should be addressing the root cause of your problem? I mean, this happens to me sometimes, but it's usually during scheduled downtime of the SCC provider for upgrades and the like.
Dave Markle
Good question, I don't know yet as I am fairly familiar with CC.NET and haven't had this problem with local repositories, only recently with remote ones, so I haven't tried others. I'll see if I get any more responses first though as I'd hate to get rid of CC.NET.
Odd
My repository is off site, hosted in another country actually. I could reduce the errors significantly if I changed the interval from 60sec to 30 mins, but I would rather not. I am not surprised that 1 out of 1440 web requests fail on our network.
Odd
Mate that's awesome, that documentation wasn't there the last time I searched for it. Exactly what I needed, though I won't know if it works for a few days it certainly appears like it will. Thanks!
Odd
np, just remember thats for the latest release so you may have to upgrade ;)
Alex