2

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

Woot4Moo
  • 23,987
  • 16
  • 94
  • 151

3 Answers3

2

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.

Carl Rosenberger
  • 910
  • 6
  • 12
  • yes however that seems completely backwards. Why would I want a local copy when I have the option to use the url? That is the entire point of using the url. However, in the interim I have been utilizing that setup. +1 – Woot4Moo May 22 '10 at 14:21
  • Don't you need a local copy on the CruiseControl machine anyway? You use it there to build locally, no? – Carl Rosenberger May 22 '10 at 14:36
  • That may be the case Carl, but my question is about why the tag does not work. – Woot4Moo May 26 '10 at 01:22
  • If you don't have a local copy, I wonder how Cruisecontrol would detect how a change has happened? Don't you think Cruisecontrol has to compare against something? – Carl Rosenberger May 26 '10 at 09:26
1

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/
[...]
Grzegorz Oledzki
  • 23,614
  • 16
  • 68
  • 106
  • Turning debug on in cruise control made my eyes bleed. Is it always supposed to drop a crap-ton of messages out to the console? None of which were errors. – Woot4Moo May 13 '10 at 20:15
  • In step 1 you weren't looking for any errors. Just the actual `svn` command executed. If it's really too much to be searchable you can try to set `DEBUG` logging for `net.sourceforge.cruisecontrol.util` package only. This one contains classes which do the actual command execution. – Grzegorz Oledzki May 13 '10 at 21:35
1

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>
mdma
  • 56,943
  • 12
  • 94
  • 128
  • could you be a bit more specific? I am a bit confused on how svnUrl != httpUrl – Woot4Moo May 20 '10 at 20:28
  • I should add, a small snippet would be infintely helpful – Woot4Moo May 20 '10 at 20:31
  • Updated my post - hopefully this is clear. The file you checked in, I presume it was under /trunk? What was the output from running svn log --non-interactive --xml -v -r {2010-05-01T01:00:00Z}:{2010-05-17T18:57:16Z} http://my/url/repo/trunk. Change the dates to coincide with the time you checked in the blank text file. – mdma May 20 '10 at 20:46
  • When you browse your repository, e.g. "http://my/url/repo/trunk" in your OP, do you see a directory listing with you text file? You mentioned tortoiseSVN - what's the version of your svn server? – mdma May 20 '10 at 20:54