Example cruisecontrol.net ccnet.config that works with msbuild and delphi XE?

I asked for some time to help get continuous integration working in Delphi earlier. One side answer has partial incomplete (not working for me) information [here] [2] for using cruisecontrol.

I got a Jenkins / Hudson job, and the easy part is that (with Delphi) the configuration is done exclusively through a web browser. However, with CruiseControl.net it is much more difficult to configure.

I would like to see a ccnet.config sample that will build the delphi hello-world project (Project1.dproj) using MSBUILD from CruiseControl and automatically restore every time subversion (or mercurial) sources are modified upstream,

So far, I:

  • installed and received CruiseControl.net version 1.6.7981 and its launch.
  • There ccnet.config no valid projects in my ccnet.config .

Here's my ccnet.config, I originally had <exec> and changed, as suggested below, to <msbuild> :

 <cruisecontrol xmlns:cb="urn:ccnet.config.builder"> <!-- CRUISECONTROL.NET Server configuration --> <project name="Project1"> <tasks> <msbuild> <projectFile>project1.dproj</projectFile> </msbuild> </tasks> </project> </cruisecontrol> 

Update: I was initially unable to read c:\builds\ccnet.config from ccnet.exe, but I found that I could run ccnet.exe (non-service mode) with a command line parameter, and this helped me find the ccnet.config problem .

+4
source share
3 answers

Here is an example configuration block for a project that rebuilds at 05:00 if a modification exists:

 <!-- DelphiCodeToDoc Project --> <project name="DelphiCodeToDoc" queue="Q1" queuePriority="1"> <category>Delphi</category> <artifactDirectory>$(ArtifactBaseDir)\DelphiCodeToDoc</artifactDirectory> <workingDirectory>$(WorkingBaseDir)\DelphiCodeToDoc</workingDirectory> <triggers> <scheduleTrigger time="05:00" buildCondition="IfModificationExists" name="Scheduled" /> </triggers> <!-- SVN implementation --> <sourcecontrol type="svn"> <trunkUrl>http://dephicodetodoc.svn.sourceforge.net/svnroot/dephicodetodoc/trunk/DelphiCodeToDoc/</trunkUrl> <workingDirectory>$(WorkingBaseDir)\DelphiCodeToDoc</workingDirectory> </sourcecontrol> <!-- Build tasks to implement --> <tasks> <!-- Compile command-line application --> <msbuild> <executable>$(MSBuildPath)\MSBuild.exe</executable> <workingDirectory>$(WorkingBaseDir)\DelphiCodeToDoc\Source</workingDirectory> <projectFile>DCTD_cmd.dproj</projectFile> <buildArgs>/target:Build /p:Config=Debug</buildArgs> <timeout>900</timeout> <logger>$(MSBuildLogger)</logger> </msbuild> <!-- Publishing compiled results --> <publishers> <merge> <files> <file>$(ArtifactBaseDir)\DelphiCodeToDoc\buildlogs*.xml</file> </files> </merge> <!-- Statistics --> <xmllogger /> <rss/> <statistics> </statistics> </publishers> </project> 

You can define $(MSBuildPath) variables as follows:

  <cb:define MSBuildPath="C:\WINDOWS\Microsoft.NET\Framework\v3.5" /> 

Or replace it with the real way.

+5
source

Instead of <exec> use this:

 <msbuild> <projectFile>project1.dproj</projectFile> </msbuild> 

Add a trigger to your project:

 <triggers> <intervalTrigger name="continuous" seconds="30" buildCondition="IfModificationExists" initialSeconds="30" /> </triggers> 

The rest should work.

+3
source

Regarding your error message

[CCNet Server: ERROR] INTERNAL ERROR: access to path 'C: \ Program Files (x86) \ CruiseControl.NET \ server \ Project1 \ WorkingDirectory' - this is denied.

you must define the working directory and the artifact directory outside of the CC.NET installation , something like c:\builds .

+1
source

Source: https://habr.com/ru/post/1401836/


All Articles