Project not showing up in Cruise Control Dashboard - continuous-integration

I'm new to continuous integration and Cruise Control. But I looked at few examples and I tried setting up a project to a pre-existing Cruise Control setup which had couple of projects in it.
I'm sure, all the files are pointed correctly and I modified the right ccnet.config.
But, the projects I added are not showing up in the web dashboard.
Here is the project block I added in the ccnet.config. (Removed the values in the elements for security reasons, but I'm sure the values are all good.)
<project>
<name></name>
<workingDirectory></workingDirectory>
<artifactDirectory></artifactDirectory>
<webURL></webURL>
<modificationDelaySeconds></modificationDelaySeconds>
<triggers>
<intervalTrigger seconds="1200" buildCondition="IfModificationExists" />
</triggers>
<sourcecontrol type="svn">
<executable></executable>
<workingDirectory></workingDirectory>
<autoGenSource>true</autoGenSource>
<trunkUrl></trunkUrl>
<username></username>
<password></password>
</sourcecontrol>
<tasks>
<nant>
<executable></executable>
<baseDirectory></baseDirectory>
<buildFile></buildFile>
<targetList>
<target></target>
</targetList>
<buildTimeoutSeconds>600</buildTimeoutSeconds>
</nant>
</tasks>
<publishers>
<xmllogger logDir="" />
<artifactcleanup cleanUpMethod="KeepLastBuilds" cleanUpValue="10" />
</publishers>
</project>
Am I missing something? Do I have to do anything else after modifying the ccnet.config? Any guidance from here would be really helpful.

Add a project name in project tag
Check the configuration file with the application CCValidator.exe in {CCNET_path}\server
If nothing appears, restart your ccnet service/batch

#Aswin R : About the issue with artifactcleanup tag, you mispell the cleanUpMethod type : KeepLastXBuilds (forgot the X in the name).
Reference : http://www.cruisecontrolnet.org/projects/ccnet/wiki/Artifact_Cleanup_Publisher

Summary of my issue:
There was an error when I ran CCValidator.
There error was with the
<artifactcleanup cleanUpMethod="KeepLastXBuilds" cleanUpValue="10" />
which said, Cannot convert String to ThoughtWorks CCnet datatype.
Removed that element and it worked!
EDIT: Mispelled KeepLastXBuilds as KeepLastBuilds.
Thanks for pointing it out TridenT

Can you add like this in the <project> tag
<project name="ProjectName">

Related

Error: The element <ParameterGroup> beneath element <UsingTask> is unrecognized

I am receiving this error, when building the solution using the msbuild.
The element <ParameterGroup> beneath element <UsingTask> is
unrecognized.
The error is showing both in msbuild and in Visual Studio.
This is because one of your project is targeting .NET 3.5.
All of your projects should be targeted to .NET 4.0 at least.
If your .cs project does not allow to view or change the Target Framework, as it was in my situation: You will need to change it manually in .csproj.
Open the .csproj in notepad.
In this line
<Project ToolsVersion="3.5"...
change the ToolsVersion to at least 4.0.
Other possibility, is that you are using <UsingTask> inside a <Target> element.
You MUST declare it outside the <Target />.
Tested on 2017 and 2019.
The error is the following otherwise. (I would bet this is #Crono sees with Roslyn).
proj(2300,5): error MSB4067: L'élément "ParameterGroup" situé sous l'élément <UsingTask> n'est pas reconnu.
Just copy the config below and create a specflow.exe.config file
Put this config file next to your specflow.exe and you will be able to create the nunitexecutionreport report.
also can use this link https://github.com/techtalk/SpecFlow/wiki/Reporting
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<startup>
<supportedRuntime version="v4.0.30319" />
</startup>
</configuration>

TeamCity: Scan all files for text

I currently use CC.NET to run an NAnt build file. In the NAnt script, I use the grep task to scan for TODO/BUG/HACK comments, and that report gets folded into the main build report. I'd like to know if that is something already built into TeamCity someway?
Or should I just create another build step to run the same NAnt script. If that is the case, where do I dump the results of that scan and how do I then pull that XML dump into the TeamCity build results? This is what my NAnt target looks like:
<target name="todoScan" description="Generate report on TODO items remaining in code">
<grep output="${base.report.dir}\${projectname}_todoscan.xml" pattern="(?'Type'TODO|BUG|HACK): (?'Text'[^\n\r]*)">
<fileset basedir="${projectdir}">
<include name="**\*.vb" />
<include name="**\*.js" />
<include name="**\*.aspx" />
<include name="**\*.ascx" />
<exclude name="**\*-vsdoc.js" />
<exclude name="**\jquery-1.3.2.js" />
</fileset>
</grep>
</target>
I am not aware of any built-in TeamCity functionality that will perform that operation.
As long as you write the file to an accessible directory you can include it in the artifacts published using the "Artifact paths" field under "1. General Settings". The file will then be accessible from the artifacts tab on the dashboard.
If you like you can then add a new tab to the dashboard that will display your file on each build if you go to "Administration", "Server Configuration", "Report Tabs" and click "Create a new report tab".
I was actually in the same situation, coming from Jenkins where I used a plugin to show things like IDEA/TODO/MUDO. Since I also moved to TeamCity recently, I made a plugin for this. It's very new and very basic, but does what it needs to do for me. If you're interested, it's available on GitHub: Todo TeamCity plugin.

XmlUpdate task not updating my XML file

I have the following task in an MSBuild script:
<XmlUpdate
Namespace="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd"
XmlFileName="$(PackageDir)\temp\OddEnds.Testing\OddEnds.Testing.nuspec"
XPath="/package/metadata/version"
Value="%(OddEndsTestingAsmInfo.Version)" />
which is supposed to update an empty version node in a NuGet specification file with the assembly version. My .nuspec file looks like this:
<?xml version="1.0" encoding="utf-8"?>
<package xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http:www.w3.org/2001/XMLSchema-instance">
<metadata xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd">
<id>OddEnds</id>
<authors>Tomas Lycken</authors>
<!-- Here's the node I want to update -->
<version></version>
<owners>Tomas Lycken</owners>
<description>Odd ends and bits that I might need in any project.</description>
</metadata>
</package>
I believe the XPath pointer /package/metadata/version points to the right node (since if I change it to something else, it complains about not finding the node) yet the output says 0 node(s) selected for update.
What am I missing?
You may need to include the namespace in your xpath string.
Check out this blog post: http://www.lesnikowski.com/blog/index.php/update-nuspec-version-from-msbuild/
You can also try //*:version. This will select all version elements regardless of namespace.
I had exactly the same problem with NuGet, XmlUpdate, MSBuild and XPath.
In the end I switched to the NuGetPack task of the MSBuild Community Tasks project.
(Note that the NuGet tasks are (at least for right now) only available in the Nightly Build)
Adding the version number to your NuGet package via MSBuild using this task would then look somehow like the following snippet:
<Target Name="NuGet">
<GetAssemblyIdentity AssemblyFiles="$(BuildCompileDirectory)\$(AssemblyName).dll">
<Output TaskParameter="Assemblies" ItemName="AssemblyIdentities"/>
</GetAssemblyIdentity>
<NuGetPack
ToolPath="$(ToolsDirectory)"
WorkingDirectory="$(BuildCompileDirectory)"
File="$(SrcDirectory)\$(SolutionName).nuspec"
Version="%(AssemblyIdentities.Version)"/>
</Target>
Hope that helps!
Your task would need to look like this:
<XmlUpdate
Prefix="xmlsucks"
Namespace="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd"
XmlFileName="$(PackageDir)\temp\OddEnds.Testing\OddEnds.Testing.nuspec"
XPath="/xmlsucks:package/xmlsucks:metadata/xmlsucks:version"
Value="%(OddEndsTestingAsmInfo.Version)" />
Feel free to change the prefix to whatever derogatory term you would like to use :-)

Configuring Cruise Control Net with sourcesafe - Unable to load array item 'executable'

I'm trying to create a continuous integration environment. To do so, I've used a guide that can be found at http://www.15seconds.com/issue/040621.htm.
In this step by step, the goal is to create a CI with CCNet, NAnt, NUni, NDoc, FxCop and source safe.
I've been able to create my build by using the command prompt (despite the the different versions issues). The problem has come with the configuration of ccnet.config
I've made some changes because of the new versions, but I'm still getting errors when starting the CCNet server.
Can anyone help me to fix this issue or point where to find a guide with this scenario?
The error that I'm getting:
Unable to instantiate CruiseControl projects from configuration document.
Configuration document is likely missing Xml nodes required for properly populating CruiseControl configuration.
Unable to load array item 'executable' - Cannot convert from type System.String to ThoughtWorks.CruiseControl.Core.ITask for object with value: "\DevTools\nant\bin\NAnt.exe"
Xml: E:\DevTools\nant\bin\NAnt.exe
My CCNet config file below:
<cruisecontrol>
<project name="BuildingSolution">
<webURL>http://localhost/ccnet</webURL>
<modificationDelaySeconds>10</modificationDelaySeconds>
<triggers>
<intervaltrigger name="continuous" seconds="60" />
</triggers>
<sourcecontrol type="vss" autoGetSource="true">
<ssdir>E:\VSS\</ssdir>
<executable>C:\Program Files\Microsoft Visual SourceSafe\SS.EXE</executable>
<project>$/CCNet/slnCCNet.root/slnCCNet</project>
<username>Albert</username>
<password></password>
</sourcecontrol>
<prebuild type="nant">
<executable>E:\DevTools\nant\bin\NAnt.exe</executable>
<buildFile>E:\Builds\buildingsolution\WebForm.build</buildFile>
<logger>NAnt.Core.XmlLogger</logger>
<buildTimeoutSeconds>300</buildTimeoutSeconds>
</prebuild>
<tasks>
<nant>
<executable>E:\DevTools\nant\bin\nant.exe</executable>
<nologo>true</nologo>
<buildFile>E:\Builds\buildingsolution\WebForm.build</buildFile>
<logger>NAnt.Core.XmlLogger</logger>
<targetList>
<target>build</target>
</targetList>
<buildTimeoutSeconds>6000</buildTimeoutSeconds>
</nant>
</tasks>
<publishers>
<merge>
<files>
<file>E:\Builds\buildingsolution\latest\*-results.xml</file>
</files>
</merge>
<xmllogger />
</publishers>
</project>
</cruisecontrol>
enter code here
This is only a first guess but configuration in <prebuild> element might be broken. Try this:
<prebuild>
<nant>
<executable>E:\DevTools\nant\bin\NAnt.exe</executable>
<buildFile>E:\Builds\buildingsolution\WebForm.build</buildFile>
<logger>NAnt.Core.XmlLogger</logger>
<buildTimeoutSeconds>300</buildTimeoutSeconds>
</nant>
</prebuild>
Just like the <tasks> block the <prebuild> block is a collection of task elements. In Your case this is a single <nant> task.
Currently I don't have access to CCNET documentation since the ThoughtWorks server is down - once again. So I'm not able to verify my advice at the moment.
BTW: Did You know that You don't have to start the server in order to verify Your configuration. Check the configuration with CCValidator.exe from [installdir]\server prior to starting CCNET server.

Is there a way to specify one artifactsDirectory for the whole site in CruiseControl.Net?

so from what i can tell, you have to specify artifacts and working directory per project, every time.
I guess I'm looking for a way to move the cc.net project name folder to other than where the server was launched from, so that I can do something like:
<cruisecontrol xmlns:cb="urn:ccnet.config.builder">
<!-- something like this should exist
<baseDirectory>D:\Integration</baseDirectory>
-->
<project name="MyProject1">
<workingDirectory>D:\Integration\working\MyProject1</workingDirectory>
<artifactDirectory>D:\Integration\artifacts\MyProject1</artifactDirectory>
<state type="state" directory="D:\Integration\state\MyProject1" />
</project>
<project name="MyProject2">
<workingDirectory>D:\Integration\working\MyProject2</workingDirectory>
<artifactDirectory>D:\Integration\artifacts\MyProject2</artifactDirectory>
<state type="state" directory="D:\Integration\state\MyProject2" />
</project>
</cruisecontrol>
Then, I won't have to specify these directories separately for each project. They will just get created under the project name under some default folder structure based on - i.e. D:\Integration\working\ being the base for
Ever thought about using preprocessor commands?
<cruisecontrol xmlns:cb="urn:ccnet.config.builder">
<cb:define name="project.template">
<project name="$(project.name)">
<workingDirectory>D:\Integration\working\$(project.name)</workingDirectory>
<artifactDirectory>D:\Integration\artifacts\$(project.name)</artifactDirectory>
<state type="state" directory="D:\Integration\state\$(project.name)" />
</project>
</cb:define>
<cb:project.template project.name="MyProject1" />
<cb:project.template project.name="MyProject2" />
</cruisecontrol>
OK, now I see. I don't think currently there is a way to do that, but would be a good feature. You should go to the google group ccnet-devel and post a message there as a feature request. I too, could use this. Good Idea.

Resources