开发者

CruiseControl modificationSet fails to execute when svn points to a url

In my current CruiseControl setup I am running the following target:

<modificationset quietperiod="30">
       <svn RepositoryLocation="http://my/url/repo/trunk" />
</modificationset>

I do a simple checkin of a blank text file and subsequently the messages I receive in the CruiseControl log are as follows:

[cc]May-13 15:53:56 Project       - Project mine:  bootstrapping
[cc]May-13 15:53:56 jectController- mine Controller: build progress event: bootstrapping
[cc]May-13 15:53:56 Project       - Project mine:  checking for modifications
[cc]May-13 15:53:56 jectController- mine Controller: build progress event: checking for modifications
[cc]May-13 15:53:59 Project       - Project mine:  No modifications found, build not necessary.
[cc]May-13 15:53:59 Project  开发者_运维问答     - Project mine:  idle
[cc]May-13 15:53:59 jectController- connectfour Controller: build progress event: idle
[cc]May-13 15:53:59 Project       - Project mine:  next build in 1 minutes
[cc]May-13 15:53:59 Project       - Project mine:  waiting for next time to build
[cc]May-13 15:53:59 jectController- mine Controller: build progress event: waiting for next time to build

Tortoise: TortoiseSVN 1.6.8, Build 19260 - 32 Bit , 2010/04/16 20:20:11

CruiseControl: 2.8.3


Maybe you need a locally checked out version of the repository so CruiseControl has something to compare to, so it can detect changes?

The way we do this in our CruiseControl setup:

We have an initial checkout routine that checks out all the required projects for the build. We use a script/batch file to do this, which operates directly against svn from the command line.

Then we use the following in our CruiseControl setup file:

<modificationset quietperiod="60">        
  <svn username="${svn.user}" 
       password="${svn.password}" 
       localWorkingCopy="${dir.checkout}/db4oj" />
</modificationset>

For every project that we check out we have one svn entry like the above in the modificationset.

The dir.checkout property will point to a concrete path in the file system.


I don't have a full answer, but this is what you can try:

  1. Turn on debug output from CruiseControl, it will print out actual commands issued by CruiseControl engine.
  2. Then you will be able to re-run the commands manually and check what's their output.

EDIT:

Adding simple log4j configuration:

log4j.logger.net.sourceforge.cruisecontrol.sourcecontrols=DEBUG

results in not so many message added to the CruiseControl log. Yet enough to learn what svn command is executed. In my logs I saw:

2010-05-17 20:57:16,808 [BuildQueueThread] INFO  BuildQueue    - now adding to the thread queue: test1
2010-05-17 20:57:16,821 [Thread-22] INFO  Project       - Project test1:  bootstrapping
2010-05-17 20:57:16,821 [Thread-22] INFO  jectController- test1 Controller: build progress event: bootstrapping
2010-05-17 20:57:16,821 [Thread-22] INFO  Project       - Project test1:  checking for modifications
2010-05-17 20:57:16,821 [Thread-22] INFO  jectController- test1 Controller: build progress event: checking for modifications
2010-05-17 20:57:16,828 [Thread-22] DEBUG SVN           - Executing command: svn log --non-interactive --xml -v -r {2010-05-16T22:00:00Z}:{2010-05-17T18:57:16Z} http://localhost/svn/SomeProject/

Now, if I issued the same command manually, I get 'empty' XML:

$  svn log --non-interactive --xml -v -r {2010-05-16T22:00:00Z}:{2010-05-17T18:57:16Z} http://localhost/svn/SomeProject/
<?xml version="1.0"?>
<log>
</log>

... as opposed to broader time range, e.g.:

$  svn log --non-interactive --xml -v -r {2001-01-01T01:00:00Z}:{2010-05-17T18:57:16Z} http://localhost/svn/SomeProject/
[...]


Just to give you another datapoint, I tried this with my (rather old) CruiseControl setup, and it worked.

  • CruiseControl v2.5
  • Subversion server v1.5.5 (r34862)
  • Apache 2.0

I was using a svn:// url so I changed to a http url to match your test, restarted cruise control. Waited for a while (I got distracted for an hour) then commited a change in one of my files in svn. Shortly after, a new build started, triggered by the modification in svn.

EDIT: To clarify, my cruise control was monitoring svn at something like svn://buildserver/svnrepo/project. Your OP mentions using a http URL. To get closer to your test scenario, I wanted also to use a http url. I had svn mapped through apache, so I just changed the URL that I was using to where apache was presenting the svn repo, e.g. http://devserver/svn/svnrepo/project to get closer to your test scenario.

My point is to show that what you are trying to do does work.

Here's a sanitised snippet from my CruiseControl config.xml file. I'm using maven (1.1beta3 !) to build. Crikey, this stuff is old, but it's working.

<project buildafterfailed="false" name="someproject-int">
        <plugin name="svn" classname="net.sourceforge.cruisecontrol.sourcecontrols.SVN">
        </plugin>
        <plugin name="svnbootstrapper" classname="net.sourceforge.cruisecontrol.bootstrappers.SVNBootstrapper">
        </plugin>    
    <labelincrementer separator="_" defaultLabel="rev_1"/>
    <bootstrappers>
      <currentbuildstatusbootstrapper file="p:/build/cc-logs/someproject-int/status.txt">
      </currentbuildstatusbootstrapper>
    </bootstrappers>
    <modificationset>
      <svn repositoryLocation="http://dev/svn/project/trunk" 
      localWorkingCopy="p:/build/checkout/int/project"
      username="build" password="****">
      </svn>      
    </modificationset>
    <schedule interval="300">
      <maven goal="scm:svn-update-project|compile" 
        projectfile="p:/build/checkout/int/project/project.xml" 
        mavenscript="d:/Programs/build/Maven-1.1b3/bin/maven.bat">
      </maven>
    </schedule>
    <log dir="p:/build/cc-logs/project" encoding="ISO-8859-1">
    </log>
    <publishers>
    [...]
    </publishers>
  </project>
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜