Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why Does CruiseControl.NET need to be restarted after GetCcNetConfigFiles?

CruiseControl.NET service needs to be restarted to pick up changes in the projects configuration files.

I find this very annoying, not sure if it's a bug or it's the way it works.

Is there any way to overcome this issue in people's experience?

like image 303
JohnIdol Avatar asked Mar 11 '09 11:03

JohnIdol


5 Answers

If your projects are separated in a different file from ccnet.config, then you need to restart the service unless you touch the actual ccnet.config.

We use ENTITY with SYSTEM file reference in ccnet.config for our projects, so we're in the same boat. I'm happy to pay the price for easier project maintenance, as it's easy to script a restart:

net stop CCService
net start CCService
IISRESET

If you wanted to completely automate this, and had your projects under source control, then you could trigger an update and restart whenever your project files are touched.

like image 142
si618 Avatar answered Nov 09 '22 23:11

si618


There was a bug in CC.Net prior to 1.4.4 if you were using a pre-processor include it did not reload the configuration when an included ccnet.config file was modified.

That was a bug that I reported and it is fixed in CC.Net 1.4.4 and greater.

Also, keep in mind that if a build is running and there is a change to the configuration it will not take place until that build is in an idle state.

like image 42
PilotBob Avatar answered Nov 09 '22 22:11

PilotBob


How are you updating your config files? By hand? Mine always recognizes and adjusts. Is your config file in source control and designed to pull it down and replace the file? This for me requires a kick. How I ended up fixing it was have my project pull it down to a seperate folder. THen I call ccnet.exe -validate on it to make sure it is well formed, then I copy it over ontop of the current config file. CC.NET recognizes the changes and loads in the new config

Exceptions: If cc.net is currently running a project, it will not recognize the changes till that project has completed.

If your ccnet.config has errors, it will not ever recognize the changes and keep running the old version it has stored in memory. (However when CC.NET does restart it will try to parse the error filled config and choke.

Hope this helps!!

like image 26
Alex Avatar answered Nov 09 '22 23:11

Alex


Do you mean you are using linked files, that is the ccnet.config file has links to the independent project files.

If so then they are not picked up, it's mentioned in the documentation that it doesn't watch the sub-files.

Internally we have modified our CruiseControl.net so that our ccnet.config is optionally a directory - and we can drop shortcuts to our project config files into that directory. We put watches on the directory, the files or shortcuts in the directory and all of the targets of the shortcuts. That means we have our project config files in ClearCase and just drop a shortcut into the ccnet.config directory.

I've just spent half a day or so moving from 1.2 to 1.4.2 dropping our changes into the new version for our internal use. We don't own our code, our client does and so it has to stay internal :(

like image 28
Alan Mullett Avatar answered Nov 09 '22 22:11

Alan Mullett


I have never experienced this. Whenever I change the configuration files, the CruiseControl.NET service seems to automatically re-read them.

I'm using Version 1.3 of CC.NET.

Update:

In the service's config file (ccservice.exe.config), there is a setting to enable/disable watching the ccnet.config file for changes:

<add key="WatchConfigFile" value="true"/>

Make sure this is set to true.

like image 1
M4N Avatar answered Nov 09 '22 23:11

M4N