Accessing CruiseControl.NET project name in NAnt - cruisecontrol.net

CCNet passes the current build label to NAnt via the NAnt property "CCNetLabel". Is there a similar property where it passes the name of the CCNet project name?

I found what I was looking for. The NAnt property is "CCNetProject".

Related

NUnit azuredevops pipeline

I made some researches but still didn't figured out this problem.
So, I made an NUnit test project, selenium with c#.
Tried to add in AzureDevops pipeline.
here is the configuration in azure
I'm getting the following error -
I Tried to change those parameters. but didn't get any other result/error.
The pipeline configuration is expecting the tests in the dll with the format **\testhost.*test*.dll. But your solution does not have any projects matching that convention.
Either you need to update the pipeline configuration to match the dll's in your project or have your tests in a different project. But you will still need to update the dll pattern as I am not sure what 'testhost' is in that?
Be sure to add the NUnit Test Adapter nuget to your project containing the tests.
See also:
https://stackoverflow.com/a/43008337/736079
When you run the test task initially it will fail. But when you see the error you can get the path of the dll files in working directory/in agent. Add that path in your task and re-run

MSBuild - Set Build Definition Name As A Property

My project team currently use TFS 2012 as our VCS and TeamCity as our Continuous Integration Server.
In TFS, we have multiple Build Definitions set up for each project and this collection include some bespoke/customised build definitions. Each build definition is driven by a unique build process template. Consequently, within each project, we have two or more customised build process templates, along with the out-of-the-box templates which include the Default and Lab templates.
We use TeamCity as our Continuous Integration system and this connects to TFS as our version control system.
Within TeamCity, I have set up a Build Configuration and Build Step which has MSBuild as the Runner type. What I am desperate now to pass to MSBuild is the name of a specific Build Definition from the collection detailed above. This build defintion will be driven by one of my customised build process templates.......not the Default, Lab or any other proecess template.
In short, what I'm keen to achieve is the ability to set a Build Definition name as an MSBuild property. It doesn't necessarily have to be from within a TeamCity context. If anyone can advise how to even achieve this from the command line, that would be perfect for now.

Does ccnet.config support changing an attribute value inside an xml file?

I'm using cruisecontrol.net to do CI, but the test type is configured in an xml file is not what I want. The xml file looks like:
<config>
<Test type="A"/>
</config>
Is there any way to change it from A to B?
I would switch mentality a bit.
Think of CC.NET as a "super fancy msbuild.exe executor".
Write most of your logic in msbuild files. Then you can easily find XmlPeek and XmlPoke (XmlUpdate) "extension tasks" that are tried and true.
This has some advantages. If you ever switch from CC.NET to something else (TFS for example), having most of your logic in an msbuild (.proj) file will make that transition very easy.
The more "proprietary" tasks you write that is CC.NET specific, the deeper you get in.
I go with this:
Have CC.NET download your .proj file.
Have CC.NET excecute msbuild.exe yourfile.proj.
Have CC.NET "merge" all resulting xml.
Have CC.NET run its "publishers" (email being the most popular)
Your .proj file will have the majority of logic.
It will pull down the rest of your code.
It will build the code.
It will zip up files or create installers or whatever.
This will serve you better than trying to get CC.NET to do everything.
I don't think there is CC.NET xml-update task.
Msbuild Community Tasks has ~lots of extra tasks to get done what you want to get done.
Yes there is with parameters. See this page:
http://cruisecontrolnet.org/projects/ccnet/wiki/Parameters
When someone forces a build a dialog pops up allowing them to choose between test type A and test type B.

Updating CCNET Last Build Label from an assembly version

I Have managed to create a CI project that uses GIT as it's source control, and an MSBuild extension to label the assemblies based on the CCNet build label, and commit that changed label
I have other projects that are manually triggered to publish this version to particular sites etc.
I would like the project status in the dashboard to display the build label (eg 2.1.345.0) from the assembly, or from a built dll, so that we can easily see which revision was published at the last manual trigger.
There's plentyof info on updating assembly info for a build, but nothing on using a assemby ifnfo version for the displayed 'last build label'
Any Ideas anybody ? Do I need to create a task to manually update the state file ? that sounds a bit dodgy.
Thanks in advance
None of the built-in labellers does what you need, but you should probably be able to write your own custom labeller to that.
You can find two custom labellers with source code here and here to get you started.

CruiseControl.NET and NAnt

I have a CC.NET project configured to call a common NAnt build file, which does some stuff, and then calls a child NAnt build file. The child build file name is specified by CC.NET to the command build file using a property.
The hurdle that I am trying to get over is that the common build file log gets overwritten by the child build file log, so I don't get the common build log in the CC.NET build log.
Anyone have any ideas on how to fix this?
I thought about changing the child build's log, but reading up on the NAnt <nant> task doesn't allow me to change the child's output log.
Use the nant task, so you get one single build file.
Is there any way that you could include the child nant file as opposed to executing it as a full-fledged child nant project? This would prevent the overwrite, but not sure if it's possible in your situation.

Resources