Quite easy:
In c:\MainCI (or any other directory), create the batch script
StartCruiseControlNET.cmd with this content:
SETLOCAL & PUSHD "%~dp0"
SET CC_HOME=%ProgramFiles%\CruiseControl.NET
"%CC_HOME%\server\ccnet.exe"
POPD & ENDLOCAL
GOTO :EOF
And run it from anywhere. It will use the ccnet.config in the current
folder. Since the PUSHD "%~dp0" sets the current folder to the folder
where the batch script is located, it will look for ccnet.config in c:
\MainCI. But the state files, artifacts and working directories will
go under "%ProgramFiles%\CruiseControl.NET\server".
However, I just found that that the location of the state file can be
specified for a project in the ccnet.config file. Just add an element
like this to the project:<state type="state" directory="c:\MainCI
\state" /> for the state file for this project to go under c:\MainCI
\state. Note that the directory attribute must be an absolute path and
must exist. Also, the location of the Artifacts and WorkingDirectory
can also be specified in the ccnet.config file by adding the following
elements to the project
configuration:<workingDirectory>ProjectNameWorkingDirectory</
workingDirectory> and <artifactDirectory>ProjectName\Artifacts</
artifactDirectory>. However, strangely enough, when the elements
workingDirectory and artifactDirectory are not specified in the
configuration for the project, they go by default under "%ProgramFiles%
\CruiseControl.NET\server", but when they are specified, they are
relative to the current folder. So for the above elements, it will put
the artifacts under c:\MainCI\ProjectName\Artifacts and
workingDirectory under c:\MainCI\ProjectName\workingDirectory.
Here is a sample ccnet.config for above:
<cruisecontrol>
<project name="MyProjectName">
<state type="state" directory="c:\MainCI\state" />
<workingDirectory>ProjectName\WorkingDirectory</workingDirectory>
<artifactDirectory>ProjectName\Artifacts</artifactDirectory>
...
</project>
</cruisecontrol>
Regards,
Georges
On Mar 24, 8:46 am, Ruben Willems <[email protected]> wrote:
> Hi
>
> this is a new trick for me
> you mean you could do the following
>
> ° place ccnet.config in 'c:\MainCI' for example
> ° Start CCnet
> ° and the state files, ... came into c:\MainCi
>
> Questions :
> ° can you post a config of a project that worked
> ° how did you start ccnet do look for the ccnet config file?
>
> with kind regards
> Ruben Willems
>
> On Tue, Mar 23, 2010 at 3:19 PM, Georges
> <[email protected]>wrote:
>
> > Hi,
>
> > With previous version of CruiseControl.NET (eg: 1.4.0.3524), the
> > current directory was not changed when the server was started. This
> > made it easy to keep configuration file ccnet.config, state files,
> > artifacts and working directories outside of the directory tree where
> > CruiseControl.NET was installed. However, with 1.5 RC1, it seems that
> > the server is able to load the configuration file ccnet.config from
> > the current directory but later changes the current directory to the
> > location of the server binary. And this is where it now saves the
> > state files, artifacts and working directories. I saw CCNET-1565 that
> > also identified this problem as a breaking change. But it was closed.
> > I also saw CCNET-144 and other similar issues, but they are all
> > considered minor, and won't probably be fixed until 1.6.
>
> > I understand that the root cause of this problem could be difficult to
> > find, as the changes in the current directory may have been done
> > almost anywhere in the CruiseControl.NET source code. But I think it
> > should be address before 1.6, since it is a breaking change from
> > previous release. Even the documentation would need to be updated, and
> > the artifacts and working directories are said to be "Relative paths
> > are relative to a directory called the project Name in the directory
> > where the CruiseControl.NET server was launched from." Could this
> > problem be addressed in some way, before 1.6? For example, could the
> > state files, artifacts and working directory be relative to the
> > location of the configuration file ccnet.config. This would give
> > everybody an easy way to keep their files outside of CruiseControl.NET
> > installation directory tree.
>
> > Thanks,
> > Georges
>
> > To unsubscribe from this group, send email to ccnet-user+
> > unsubscribegooglegroups.com or reply to this email with the words "REMOVE
> > ME" as the subject.
To unsubscribe from this group, send email to
ccnet-user+unsubscribegooglegroups.com or reply to this email with the words
"REMOVE ME" as the subject.