views:

364

answers:

3

CruiseControl.net creates (by default) for each project a subdirectory under: c:\Program File\CruiseControl.NET\server

How can I change that? (it's such a bad idea to mix data with program files...)

I found a way to configure the artifacts directory per project, but that's not quite it (it's merely a subdirectory of the project directory).

+1  A: 

I have CC.NEt not installed here, and I have atm no access to my build-server at work, but if I remember well, you should find 2 configuration files in your c:\Program Files\CruiseControl.NET folder.

ccnet.exe.config and ccservice.exe.config.

The first configuration file is used when you run CC.NET using the console app, the second one is used when you start CC.NET as a service.

In those files, you should find a configuration-setting which points to the location where the configuration-file(s) that describe the build-process for your projects can be found.

edit: In the ccservice.exe.config file, you'll find a key in the appSettings section which is called ccnet.config. Change the value of this key to the path where you want to put the ccnet.config file.
If this key is not present, you can add it:

<appSettings>
    <!-- Without this appSetting ccservice will look for ccnet.config in its own directory. -->
    <add key="ccnet.config" value="D:\CCNetConfigFiles\ccnet.config"/>
</appSettings>

This is how I've done it:

  • I've changed the ccnet.config appSetting in the ccservice.exe.config file, so that CruiseControl.NET searches for the ccnet.config file in a different location instead of the standard location. (As described above). (I understand that you do not want to do this ?)
  • I've changed the ccnet.config file itself, so that it looks like this:
<!DOCTYPE cruisecontrol [
    <!ENTITY project1     SYSTEM "file:D:\CCNETConfigFiles\project1\project1buildconfig.xml.config">
    <!ENTITY project2        SYSTEM "file:D:\CCNETConfigFiles\project2\project2buildconfig.xml.config">
    <!ENTITY project3    SYSTEM "file:D:\CCNETConfigFiles\project3\project3buildconfig.xml.config">
]>
<cruisecontrol>

  &project1;
  &project2;
  &project3;

</cruisecontrol>

By doing this, I can have each project configuration in its own file, and I can put each project-configuration in its own directory.

  • Then, I just have to make sure that in each project config-file, I remove the cruisecontrol tags, because otherwise the ccnet.config file wouldn't validate against the schema.
Frederik Gheysels
That wasn't my question. Projects are configured in ccnet.config. I'm interested in how to configure the directory into which the project _folders_ are added whenever you add a new project.
Assaf Lavie
You should read my answer better, i guess.
Frederik Gheysels
I have, just now. Maybe I'm misunderstanding something. "the location where the configuration-file(s) that describe the build-process for your projects" is the \server directory. Under which several sub directories exist, one per project. These sub directories do not contain configuration files. They mostly contain the artifacts from the build. Are you suggesting that the location of these subdirectories is determined in ccservice.exe.config? Because I couldn't find it there.
Assaf Lavie
Check the edit of my answer.
Frederik Gheysels
Will changing the location of ccnet.config also change where the project sub-folders are created? (I would like to keep ccnet.config where it is, and at the same time move all project directories out of Program Files\ccnet\server\...)
Assaf Lavie
i've editted my answer again
Frederik Gheysels
A: 

Probably not the answer you're waiting for, but could still be interesting: we're using about twenty build machines with about fifty different builds. Because indeed it's not a good idea to mix data with program files, we decided to put our ccnet installation in source control. Each server has its own configuration file in that directory (also in source control) and a local batch file or short cut starting ccnet specifies which configuration file is used. This means that local data (the build logs) are mixed with data that is in perforce (ccnet binaries/configuration files), but we have accepted that situation. Hope this helps.

Regards,

Sebastiaan

Sebastiaan Megens
Well, it doesn't really answer my question. I do keep all the non-binary files in my cc.net installation under SVN, though. That's a good idea.
Assaf Lavie
+4  A: 

Set the project's working and artifact directory and You're done. They default to:

  • [ccnet-install-dir]\[project-name]\WorkingDirectory
  • [ccnet-install-dir]\[project-name]\Artifacts.

If You e.g. set these directories to...

  • [projects-dir]\[project-name]\WorkingDirectory
  • [projects-dir]\[project-name]\Artifacts

... You can safely remove the [ccnet-install-dir]\[project-name] subtree (You will loose Your project build history then).

So Your configuration will look like this:

<project name="foo">
  [...]
  <workingDirectory>C:\projects\foo\WorkingDirectory</workingDirectory>
  <artifactDirectory>C:\projects\foo\Artifacts</artifactDirectory>
  [...]
</project>
The Chairman
Yes, but *how* do you set those directories?
splattered bits
@splattered bits: Added configuration snippet. Should be clearer now.
The Chairman