CruiseControl.Net build logs not showing on CCNet website after upgrade - cruisecontrol.net

We've been using CruiseControl.Net for a couple of years now and it has been working fine. However, since our last upgrade a few weeks ago to the latest version (1.5.0.6237) our build reports are failing to display on the ccnet website. Instead we get the following message:
"BUILD FAILED
Project: TX
Date of build: 2010-06-22 23:41:54
Running time: 00:05:06
Integration Request: Build (ForceBuild) triggered from ScheduleTrigger
Last changed: 2010-06-22 15:14:14
Last log entry: Merge Branches:
Origin=$/Source/RE/Branches/3.1
Version: 2629 [DT- 3652]: Reporting:
Capture tradable duration seperately
Modifications since last build (10)
Checked in Donald.sutherland Trunk/SLP/SLPDatabase/CreateScripts/CreateReportDataStoreTables.sql
Merge Branches: Origin=$/Source/RE/Branches/3.1
Version: 2629 [DT-3652]: Reporting:
Capture tradable duration seperately
2010-06-22 15:14:14
Checked in Donald.sutherland Trunk/SLP/SLPDatabase/Change Scripts/ReportDataStore/RpDataStoreDatabaseChangeScript.sql
Merge Branches: Origin=$/Source/RE/Branches/3.1
Version: 2629 [DT-3652]: Reporting:
Capture tradable duration seperate
What should follow is a number of error messsages indicating why the build has failed. The webpage that is failing to parse the log file is "ViewBuildReport.aspx". In order to get an explanation, our development team has to go through the full Build Log xml and search for failures.
The build.config file is attached below:
<project name="TX" queue="Build" queuePriority="1400">
<triggers>
<scheduleTrigger time="21:00" buildCondition="ForceBuild">
<weekDays>
<weekDay>Monday</weekDay>
<weekDay>Tuesday</weekDay>
<weekDay>Wednesday</weekDay>
<weekDay>Thursday</weekDay>
<weekDay>Friday</weekDay>
<weekDay>Saturday</weekDay>
<weekDay>Sunday</weekDay>
</weekDays>
</scheduleTrigger>
</triggers>
<sourcecontrol type="vault" autoGetSource="true" applyLabel="false">
<executable>c:\program files\sourcegear\vault client\vault.exe</executable>
<username>build</username>
<password>*********</password>
<host>niddrie.dataexplorers.net:8080</host>
<repository>DXL Source</repository>
<folder>$/Source/TX/Trunk</folder>
<ssl>false</ssl>
<useWorkingDirectory>true</useWorkingDirectory>
<workingDirectory>D:\Projects\Source\TX\Trunk</workingDirectory>
<cleanCopy>true</cleanCopy>
<timeout units="minutes">30</timeout>
</sourcecontrol>
<tasks>
<msbuild>
<executable>C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\MSBuild.exe</executable>
<workingDirectory>D:\Projects\Source\TX\Trunk</workingDirectory>
<projectFile>TransactionExplorer.sln</projectFile>
<buildArgs>/noconsolelogger /p:Configuration=Release /v:diag</buildArgs>
<targets>Build</targets>
<timeout>600</timeout>
<logger>C:\Program Files\CruiseControl.NET\server\ThoughtWorks.CruiseControl.MSBuild.dll</logger>
</msbuild>
<exec>
<executable>deploy.bat</executable>
<baseDirectory>D:\Projects\Source\TX\Trunk</baseDirectory>
<buildArgs>D:\Projects\Source\TX\Trunk D:\MasterWebsite\SfsWebroot\Autobuild\TX</buildArgs>
<buildTimeoutSeconds>500</buildTimeoutSeconds>
</exec>
</tasks>
<publishers>
<!-- Mandatory, config file does not work without -->
<xmllogger logDir="C:\Program Files\CruiseControl.NET\server\TX\Artifacts\buildlogs" />
&email;
</publishers>
</project>
As you can see, there is a publisher and the config file hasn't changed since we upgraded to the latest CruiseControl Version. Finally, the necessary log files get generated during the build so it seems to be an issue with the xsd parse or the website itself? The build result files generated are listed below:
C:\Program Files\CruiseControl.NET\server\TX\Artifacts\msbuild-results.xml
C:\Program Files\CruiseControl.NET\server\TX\Artifacts\buildlogs\log20100622234154.xml
Any help to get this working will be greatly appreciated.

Did you check your email publisher? There have been a breaking change with CCNET 1.5. You can read more here :
http://ccnetlive.thoughtworks.com/ccnet/doc/CCNET/CCNet%201.5%20CTP%20Release%20Notes.html
http://ccnetlive.thoughtworks.com/ccnet/doc/CCNET/Email%20Publisher.html
If I understood you well, you said that your build worked fine but since you upgraded it fails, isn't it? How did you do the upgrade? Did you change directory/rights?

Related

${currentdir} target is not generating file anymore

I have recently upgraded my asp.net core project to .net core 2.2 and at same time updated NLog.Web.AspNetCore.
After I did this (maybe coincidence?) I noticed that log files are not being generated.
In my config this is my target:
<target xsi:type="File" name="allfile" fileName="${currentdir}/Logs/nlog-all-${shortdate}.log"
layout="${longdate}|${event-properties:item=EventId_Id}|${uppercase:${level}}|${logger}|${message} ${exception:format=tostring}" />
After some debugging I realised that if I specified the path explicitly then it would generate log file:
<target xsi:type="File" name="allfile" fileName="E:\Project\Logs\nlog-all-${shortdate}.log"
layout="${longdate}|${event-properties:item=EventId_Id}|${uppercase:${level}}|${logger}|${message} ${exception:format=tostring}" />
I have throwExceptions="true" set in config but when a file is not generated no exception is thrown, it just silently doesn't create the file.
To further debug this I created a console project and added nuget NLog.Web.AspNetCore and copied my config. Now in the console project it works fine and is creating log files in the debug output directory.
Is there any way to debug why the log file isn't being generated with this target in my main project?
Instead of using ${currentdir} then consider using ${aspnet-appbasepath} (Or ${basedir} if not in-process-hosting)
NLog InternalLogger usually gives very good hints when something is not working as expected.
Please avoid using throwExceptions="true" as it is for unit-testing, and not for production environments.

Server Error in '/ccnet' Application

My CCTray says build is broken and on the server(http://172.25.165.10/ccnet/)
I get this error
Server Error in '/ccnet' Application.
Configuration Error
<cruisecontrol xmlns:cb="urn:ccnet.config.builder">
<!-- This is your CruiseControl.NET Server Configuration file.
Add your projects below! -->
<project name="winapp"
description="demoproject showing a small config" queue="Q1">
<webURL>http://172.25.165.10/ccnet/</webURL>
<!-- specify a state folder to prevent CCNet from saving it in Program Files\CruiseControl.NET\server
programs may not standard write their data in it on windows Vista and up)
-->
<sourcecontrol type="svn">
<trunkUrl>https://citdevbox.arcade.local:8443/svn/cardwellR/trunk/winapp</trunkUrl>
<workingDirectory>c:\builds\winapp</workingDirectory>
<username>***</username>
<password>***</password>
</sourcecontrol>
<state type="state" directory="C:\CCNet\State" />
<!-- specify a artifactDirectory to prevent CCNet from saving it in Program Files\CruiseControl.NET\server
programs may not standard write their data in it on windows Vista and up)
-->
<artifactDirectory>C:\CCNet\BuildArtifacts\MyFirstProject</artifactDirectory>
<tasks>
<msbuild>
<executable>C:\WINDOWS\Microsoft.NET\Framework\\v3.5\MSBuild.exe</executable>
<projectFile>C:\Builds\build\BootStrapper.msbuild</projectFile>
<buildArgs>/noconsolelogger /t:CTSx86;BuildZip /v:d</buildArgs>
<logger>ThoughtWorks.CruiseControl.MsBuild.XmlLogger,C:\Program Files\CruiseControl.NET\server\ThoughtWorks.CruiseControl.MsBuild.dll</logger>
<timeout>900</timeout>
</msbuild>
</tasks>
<triggers>
<!-- check the source control every X time for changes,
and run the tasks if changes are found -->
<intervalTrigger
name="continuous"
seconds="300"
buildCondition="IfModificationExists"
initialSeconds="5"/>
</triggers>
<publishers>
<xmllogger />
<artifactcleanup cleanUpMethod="KeepLastXBuilds"
cleanUpValue="50" />
</publishers>
</project>
</cruisecontrol>
Description: An error occurred during the processing of a configuration file required to service this request. Please review the specific error details below and modify your configuration file appropriately.
Parser Error Message: The root element must match the name of the section referencing the file, 'appSettings'
Source Error:
Line 1: cruisecontrol xmlns:cb="urn:ccnet.config.builder"
Source File: C:\Program Files (x86)\CruiseControl.NET\server\ccnet.config Line: 1
Version Information: Microsoft .NET Framework Version:2.0.50727.5456; ASP.NET Version:2.0.50727.5456
You didn't post the content of your ccnet.config file which the error you are getting is complaining about. Lets start with the obvious. I would look to see if there is a typo in there, for example maybe a missing quote or something in the appSettings section. If you have the unmodified version revert back to that and see if your issue goes away and compare the unmodified with the modified.
There is an app called CCValidator which will tell you where the error is in your ccnet.config file. I suspect that is not where the problem is. It sounds like the error is in the ccservice.exe.config. Perhaps someone accidentally copied ccnet.config to ccservice.exe.config. The error may also be in your web dashboard's configuration.
I solved the issue by removing the build args tag.
</noconsolelogger /t:CTSx86;BuildZip /v:d>
My processor was 64 bit and I was using noconsolelogger /t:CTSx86 which is for a 32 bit processor. Anyway these were optional so I removed it worked fine.

Multi Projects with CCNET

I have GIT repo as below,
\main
\Module A
\Module B
\Shared
When i make a change on Module B, CCNET will make a build from Module A and then Module B,
I dont want CCNET to do this way.It will take a lot of time.
I just want ccnet build only changes on Module B.
Somebody please help me :
My 1 project in CCNET Config:
enter code here
<project name="Dashboard 5.0" queue="Dashboard_01" queuePriority="01" category="01">
<artifactDirectory>&pathToArtifactsDirectory;Dashboard 5.0\</artifactDirectory>
&workingDirectory;
<webURL>http://&buildServerAddress;/ccnet/server/&buildServerName;/project/Dashboard 5.0/ViewLatestBuildReport.aspx</webURL>
&modificationDelaySeconds;
<triggers>
<intervalTrigger seconds='30' buildCondition='IfModificationExists'/>
<scheduleTrigger time='03:00' buildCondition='ForceBuild' name='Scheduled'/>
<scheduleTrigger time='11:00' buildCondition='ForceBuild' name='Scheduled'/>
</triggers>
<state type="state" directory="&pathToStatesDirectory;Dashboard 5.0\" />
<sourcecontrol type="git">
<repository>&gitAddress;</repository>
<branch>master</branch>
<autoGetSource>true</autoGetSource>
<fetchSubmodules>false</fetchSubmodules>
<executable>C:\Program Files (x86)\Git\cmd\git.exe</executable>
<commitBuildModifications>false</commitBuildModifications>
<commitUntrackedFiles>false</commitUntrackedFiles>
<timeout>3000000</timeout>
</sourcecontrol>
<tasks>
<nant>
<executable>&pathToNantFile;</executable>
<baseDirectory>&pathToBuildScriptsDirectory;Dashboard 5.0\</baseDirectory>
<buildArgs>-D:projects_to_build=dashboard_framework</buildArgs>
<buildFile>cruise.build</buildFile>
<targetList>
<target>automate</target>
</targetList>
<buildTimeoutSeconds>3000</buildTimeoutSeconds>
</nant>
</tasks>
<publishers>
<merge>
<files>
<file>&pathDB5MainCheckoutDirectory;framework\build\test-reports\*Test.dll-results.xml</file>
<file>&pathDB5MainCheckoutDirectory;framework\build\test-reports\Test*.dll-results.xml</file>
<file>&pathDB5MainCheckoutDirectory;framework\build\test-reports\simian.xml</file>
</files>
</merge>
<xmllogger />
</publishers>
Any check in for Module A or Module B will cause the project node to start either way. What you are looking for is similar to what subversion update command on a sub folder does and Git is not intended to be this way. An alternative you can create a separate repository for each module. The build script or Nant task would have to be separated as well.
In Git, if you have several directories that are always checked out independently, then these are really two different projects and should live in two different repositories. You can merge them back together at a later point using Git Submodules

Getting MSTest output to show in CruiseControl.Net

I currently have our build server set up with CruiseControl.Net running a build using MSBuild and then running unit tests using MSTest. The problem is I can't see the output of the unit tests in CC - I know they are being run because I can get the build to fail if I commit a failing test.
I have followed the online guides from http://blogs.blackmarble.co.uk/blogs/bm-bloggers/archive/2006/06/14/5255.aspx and http://www.softwarepassion.com/?p=89 but still having no luck.
My ccnet.config file contains
<tasks>
<msbuild>
<executable>C:\WINDOWS\Microsoft.NET\Framework\v3.5\MSBuild.exe</executable>
<workingDirectory>C:\CCBuilds</workingDirectory>
<projectFile>Application.sln</projectFile>
<buildArgs>/noconsolelogger /p:Configuration=Debug /v:diag</buildArgs>
<targets>Build</targets>
<timeout>900</timeout>
<logger>C:\Program Files\CruiseControl.NET\server\ThoughtWorks.CruiseControl.MsBuild.dll</logger>
</msbuild>
<exec>
<executable>deleteTestLog.bat</executable>
<baseDirectory>C:\CCBuilds</baseDirectory>
<buildArgs></buildArgs>
<buildTimeoutSeconds>30</buildTimeoutSeconds>
</exec>
<exec>
<executable>C:\Program Files\Microsoft Visual Studio 9.0\Common7\IDE\mstest.exe</executable>
<baseDirectory>C:\CCBuilds</baseDirectory>
<buildArgs>/testcontainer:UnitTests\bin\Debug\UnitTests.dll /runconfig:localtestrun.Testrunconfig /resultsfile:testResults.trx</buildArgs>
<buildTimeoutSeconds>30</buildTimeoutSeconds>
</exec>
</tasks>
<publishers>
<merge>
<files>
<file>testResults.trx</file>
</files>
</merge>
<xmllogger logDir="C:\Program Files\CruiseControl.NET\server\Checkin Build\Artifacts\buildlogs" />
</publishers>
The log file in C:\Program Files\CruiseControl.NET\server\Checkin Build\Artifacts\buildlogs contains the unit test results, have I missed any steps?
i made the following changes to get MSTest results output to be shown in CruiseControl.NET
1) For Dashboard - in dashboard.config added a reference to the Mstest 2008 xsl file under buildReportBuildPlugin
<xslFile>xsl\MsTestReport2008.xsl</xslFile>
2) For email - in ccservice.exe.config added the reference to the same xsl file under xslFiles section
<file name="xsl\MsTestSummary2008.xsl"/>
Did you configure your web dashboard with the correct xsl to format the outputs? There are two different versions of the XSL's (Summary and Report) for VSTS 2005 and 2008 as Microsoft changed the XML output drastically between the two versions. The changes were very good, just breaking changes.
For the Dashboard, I think you need to add the MSTest Summary in the xlsFiles, but add the MSTest Report build report plugin. That is,
<buildReportBuildPlugin>
<xslFileNames>
<xslFile>xsl\MsTestSummary2008.xsl</xslFile>
</xslFileNames>
</buildReportBuildPlugin>
<xslReportBuildPlugin description="MSTest Report" actionName="MSTESTReport" xslFileName="xsl\MsTestReport2008.xsl" />
</buildPlugins>
I tried adding MSTestReport on both but it didn't work, but the setting above did. Hope that helps...

CruiseControl.NET post-build actions

We have CC.NET setup on our ASP.NET app. When we build the project, the ASP.NET app is pre-compiled and copied to a network share, from which a server runs the application.
The server is a bit different from development box'es, and the next server in our staging environment differs even more. The difference is specific config files and so on - so I want to exclude some files - or delete them before the pre-compiled app is copied to a network share.
My config file looks like this:
<project name="Assembly.Web.project">
<triggers>
<intervalTrigger seconds="3600" />
</triggers>
<sourcecontrol type="svn">
<trunkUrl>svn://svn-server/MyApp/Web/Trunk</trunkUrl>
<workingDirectory>C:\build-server\Assembly\Web\TEST-HL</workingDirectory>
<executable>C:\Program Files (x86)\SVN 1.5 bin\svn.exe</executable>
<username>uid</username>
<password>pwd</password>
</sourcecontrol>
<tasks>
<msbuild>
<executable>C:\Windows\Microsoft.NET\Framework64\v3.5\MSBuild.exe</executable>
<workingDirectory>C:\build-server\Assembly\Web\TEST-HL</workingDirectory>
<projectFile>C:\build-server\Assembly\Web\TEST-HL\Web\Web.sln</projectFile>
<buildArgs>/noconsolelogger /p:Configuration=Debug /v:diag</buildArgs>
<targets>Build</targets>
<timeout>900</timeout>
<logger>C:\Program Files\CruiseControl.NET\server\ThoughtWorks.CruiseControl.MsBuild.dll</logger>
</msbuild>
</tasks>
<publishers>
<buildpublisher>
<sourceDir>C:\build-server\Assembly\Web\PrecompiledWeb</sourceDir>
<publishDir>\\test-web01\Web</publishDir>
<useLabelSubDirectory>false</useLabelSubDirectory>
<alwaysPublish>false</alwaysPublish>
</buildpublisher>
</publishers>
</project>
As you can see, I use a buildPublisher to copy the pre-compiled files to the network share. What I want to do here, is either 1) delete certain files before they are copied or 2) replace those files after they have been copied.
I DO NOT want to have some app running watching specific files for change, and then after that replace the files with other ones. I want something to be either done by CC.NET, or triggered by CC.NET.
Can you launch a .bat file with CC.NET?
I use a NAnt task for all publishing, deploying, cleaning and so on.
Take a look at MSDEPLOY or Web Deployment Projects. There is a question that will provide more detail here
You have to use NAnt for those kind of stuff.
Here is the Task Reference of Nant..
Of course CruiseControl.NET can run a batch file, simply use the exec task. However, an easier answer might just be to have MSBuild do the task for you. It should be simple to add a few steps in the postcompile target.

Resources