Handling svn locks / cleanup when using CruiseCont

2019-04-10 16:41发布

I am using CruiseControl .NET with the Subversion source control plugin to automatically build our project.

Some of the projects are automatically checking for modifications, but occasionally the check fails and CruiseControl .NET marks the project with an "Exception":

ThoughtWorks.CruiseControl.Core.CruiseControlException: Source control operation failed: svn: Working copy 'xxFilename' locked svn: run 'svn cleanup' to remove locks (type 'svn help cleanup' for details)

After this I must manually log into the server and do a svn cleanup on the folder before the project will build again. Is there a workaround for this?

3条回答
成全新的幸福
2楼-- · 2019-04-10 17:07

The new Cruise Control.Net 1.4.4 server has two additional properties on the Subversion Source Control Block.

See CCNET Documentation - Subversion Source Control Block

The cleanUp and revert properties does what you want.

查看更多
别忘想泡老子
3楼-- · 2019-04-10 17:16

Kinda of a kludge but could you create a project that runs on demand and does an svn cleanup?

I know you can in the Java version of CruiseControl so I assume you can do the same w/CC.NET.

查看更多
疯言疯语
4楼-- · 2019-04-10 17:19

You should be able to use a publisher task in the project configuration.

The Project Configuration Block has a publishers task that will execute after every build.

Using an executable task, you can pass in the current integration status as an environment variable, and that will allow you to use a simple script or command to decide whether or not to execute the svn cleanup.

For eg, all you need would be:
if %CCNetIntegrationStatus% == "Exception" svn cleanup

Disclaimer: I've only really played around with CC, and this is from the docs, not experience.

查看更多
登录 后发表回答