I try to combine CC.NET with Gendarme. I use CC.NET 1.5.
Gendarme already checks the build and generates a report.
But I can't get the dahsboard to show the report. How can I do it?
I added this in my ccnet.config:
<merge><files>
<file>C:\MyProjectArtefacts\gendarme-results.xml</file>
</files></merge>
And that to my dashboard.config:
<xslFile>xsl\gendarme-summary-ccnet.xsl</xslFile>
<xslReportBuildPlugin description="Gendarme Report" actionName="GendarmeBuildReport" xslFileName="xsl\gendarme-report-ccnet.xsl"/>
any ideas?
thanks
Related
Okay.. I've been searching this specific question, and did find some examples, but not exactly the answer I wanted. Any thoughts, inputs would be greatly appreciated!
Situation I have is..
I have a daily build process via CCNet. They all have a buildCondition="ifModificationExists" parameter when building. This allows the CCNet to build if and only if there are modifications (checking the source "Update").
Problem is, I added a version Commit process at the very last part of each builds. Meaning, if I were to build 1.0.0.3, I'd Commit the changed AssemblyInfo.cs files (that contains the updated version number), and allows me to check the logs when each of the versions were built.
This completely screwed up the entire automated daily build process.. You see, because it commits the version every build whether or not it has any other Updates, the CCNet considers there's ALWAYS a modification before building each morning. Fact is, the only modification there has been was the version update from last build.
I cant think of a way to get around this, by keeping the version update + daily automate build when modifications exists.
Any help? :)
edit 1. here's the Triggers part for each of my build:
<!--TRIGGERS -->
<triggers>
<scheduleTrigger time="04:00" buildCondition="IfModificationExists" name="Scheduled">
</scheduleTrigger>
</triggers>
edit 2. and here's the part where I commit the files (AssemblyInfo.cs) using powershell
<powershell>
<script>commit.ps1</script>
<executable>C:\WINDOWS\system32\WindowsPowerShell\v1.0\powershell.exe</executable>
<scriptsDirectory>D:\SRC\BuildTools</scriptsDirectory>
<buildArgs>D:\SRC\ProjectName\branches\3.0.3\</buildArgs>
<description>BuildCommit Dir D:\SRC\ProjectName\branches\3.0.3\src</description>
</powershell>
Thank you in advance,
I think you should be able to use filtered source control to do what you need:
http://cruisecontrolnet.org/projects/ccnet/wiki/Filtered
I'm using CruiseControl.NET to run visual studio test cases after my project builds. In the raw xml log I can see it running the test cases and saying which passed and which failed, however on the CruiseControl dashboard all it says is:
9 Projects built with no warnings at all :-)
Juchuu !!!
Here's what my project block looks like:
<project name="projectname" queue="queuename" queuePriority="2">
<workingDirectory>C:\Build</workingDirectory>
<category>categoryname</category>
<webURL>http://myurl/ViewProjectReport.aspx</webURL>
<triggers>
<intervalTrigger seconds="60" />
</triggers>
<modificationDelaySeconds>60</modificationDelaySeconds>
≻
<tasks>
<msbuild>
<executable>C:\WINDOWS\Microsoft.NET\Framework\v3.5\MSBuild.exe</executable>
<workingDirectory>C:\mypath</workingDirectory>
<projectFile>project.sln</projectFile>
<buildArgs>/v:quiet /noconlog /p:Configuration=Debug</buildArgs>
<targets>Build</targets>
<timeout>900</timeout>
<logger>C:\Program Files\CruiseControl.NET\server\Rodemeyer.MsBuildToCCnet.dll</logger>
</msbuild>
<exec>
<executable>C:\Program Files\Microsoft Visual Studio 9.0\Common7\IDE\mstest.exe</executable>
<baseDirectory>C:\Build\Test\TestCases\</baseDirectory>
<buildArgs>/testcontainer:testproject\bin\debug\testproject.dll /runconfig:localtestrun.Testrunconfig</buildArgs>
<buildTimeoutSeconds>900</buildTimeoutSeconds>
</exec>
</tasks>
<publishers>
<xmllogger logDir="C:\Program Files\CruiseControl.NET\Logs\Navtrak\H4CommandProcess\" />
</publishers>
</project>
How do I get the passed/failed test cases to show up on the cruisecontrol dashboard page for that specific build?
Thanks,
Justin
See this article for some tips on how to get MSTest results to appear in CruiseControl.Net:
http://confluence.public.thoughtworks.org/display/CCNET/Using+CruiseControl.NET+with+MSTest
Essentially what you need to do is:
Get MSTest to save its test results to an xml (.trx) file (your raw build output might show test results in a test format, however CruiseControl.net needs the results in xml format)
Get CruiseControl.Net to merge this xml file into your cruise control build log.
Add an extra build report that uses an XSLT to show transform the xml test results into pretty html.
The above article goes into more detail on how to do this, as well as a couple of extra considerations (such as deleting old test results).
Also, I've noticed that you are using Visual Studio 2009 - something that the above article does not emphasis is that when you are setting up your dashboard to shown MSTest results, you need to make sure you use the VS2009 specific xslt in the CruiseControl.Net directroy, as the standard one won't display any results on the dashboard.
I am Using CC.Net to run an .exe file after project build is complete and need to pass the project name, publish date/time and user on the command line as parameters to the .exe. However I can't get cc.net to recognise these a dynamic properties and replace them with the correct values.
<publishers><exec executable="C:\MyApp.exe"></exec><buildArgs>"$[$CCNetProject]" "$[$CCNetBuildDate]" "$[$CCNetBuildTime]" "$[$CCNetUser]"</buildArgs><buildTimeoutSeconds>30</buildTimeoutSeconds></publishers>
The correct syntax for properties in ccnet config is $[CCNetProject]
I believe the correct syntax for properties in ccnet config is:
$[CCNetProject]
Rather than:
$[$CCNetProject]
I have created a custom labeller for CC.Net which is working almost perfectly, however it appears that the labeller runs before the application is built. The issue I have with this is that I want my build label to be that of my AssemblyVersion.
I have the following in my labeller:
public string Generate(IIntegrationResult previousResult)
{
if (File.Exists(this.OutputExecutable))
{
Assembly assembly = System.Reflection.Assembly.Load(System.IO.File.ReadAllBytes(this.OutputExecutable));
string version = assembly.GetName().Version.ToString();
assembly = null;
return version;
}
else
{
return "0.0.0.0";
}
}
This gets the version of the provided DLL/Exe so that I can use it as my build label. I'll probably go on to add the actual build number in later, but I just want to get this bit working first.
The issue is that my Revision number is in the format 2.0.93601.254 major.minor.date.svnrevision. When a check-in occurs, I build the codebase and the revision number would go to 2.0.93601.255. Unfortunately CC.Net still produces a Build Label of .254 until a force build is called when it will be successfully changed to .255.
Is there any way I can force the labeller to wait until the build process is complete? Or are there any alternative ways I should be doing this?
The answer to this I believe is no. What I did was to create my own console application that updates the assemblyinfo.cs file before the MSBuild task in CC.Net's project configuration. Problem (kind of) solved.
This is backwards from how most people do this; you make ccnet set the version of your code & assemblies automatically, pulling the version from config and say the svn rev #.
This is why it is critically important the labeller runs before tasks.
I searched a lot but i didn't find a solution for my problem.
I use CruiseControl.NET (1.4.4). My project (in ccnet.config) load a repository from a cvs server to a local repository, and launch some executables (msbuild, NUnit...).
I use a trigger (Interval or Schedule Trigger), that launch regularly my project. But if my project has not been modified, it always launch all next tasks. And I would like to avoid it. So i want to launch my project only if a commit has been detected.
Is there any solution for it please?
Thanks
Olivier
Your trigger needs to specify IfModificationExists:
<intervalTrigger
name = "dave"
seconds = "30"
buildCondition = "IfModificationExists" />
Although buildCondition="IfModificationExists" is the default anyway, so as long as its not set to ForceBuild you should be fine.
EDIT:
The URL Trigger might be of some use to you. You can set your svn server to modify a page on commmit and the CC.Net checks the page to see if it has changed, thus not getting all the files.
I start my project as below, which ensures that the tasks get executed only if there are modifications.
Hope this helps,
Anders, Denmark
Edited: My code excerpt didn't make it to the page - I've tried to replace less-than, bigger-than with brackets.
[project name="SpilMerePool" queue="Q2" queuePriority="1"]
[sourcecontrol type="svn"]
[trunkUrl]https://ajf-ser1.ajf.local:8443/svn/SpilMerePool/trunk[/trunkUrl]
[workingDirectory]c:\from_vc\SpilMerePool[/workingDirectory]
[executable]C:\Program Files\VisualSVN Server\bin\svn.exe[/executable]
[username]username[/username]
[password]password[/password]
[/sourcecontrol]
Just use IntervalTrigger, like this:
<triggers>
<intervalTrigger />
</triggers>
You can also add an modificationDelaySeconds, to wait for a number of seconds before starting the build after the last commit.
<modificationDelaySeconds>30</modificationDelaySeconds>
Thank you Anders Juul abd Andy for your quick answers.
By using the intervalTrigger with "IfModificationExists" build condition, the project must be loaded each time (it's logical ^^). But my project size is about 450Mo. So it's a little long.
So my last question is : can we execute all builds and next tasks when a commit command has been detected? (without loading all files, in CruiseControl).
I use TortoiseCVS (version 1.10.10). Maybe we can force CruiseControl project to be lauched after a commit?