Using Team City with NAnt for .NET - continuous-integration

I am starting to use Team City, I would like to add NAnt to build my .NET projects and also a way to run sql files from a folder. What is the best way to achieve this and is there a tutorial for this?, or what is the best way to do this?. I checked on google but I quite do not understand the process or where to start. I have team city installed and nant. If anyone could point me in the right direction I would appreciate it.

Teamcity comes with a NAnt runner: http://confluence.jetbrains.com/display/TCD8/NAnt
The best way to make it work is:
- build your own script
- test it on your own machine, without teamcity
- commit the script into source control
- configure teamcity to run it using the NAnt runner
this way in case of future troubles you can always debug your script locally.
Hope it helps.

Related

Configure CruiseControl.NET with SonarQube

The project I currently work on uses CruiseControl.NET 1.8.4.0 and I want to integrate it with SonarQube. This is the only information I found about this here and I could not make it work.
Could someone please enlighten me how can this be achieved.
I know nothing about sonarqube but I know a lot about cruisecontrol. Cruisecontrol.net is just a queue that runs tasks. All the actual work in the tasks is done by things other than ccnet for example msbuild, nant, etc. So I'm guessing your situation is similar where ccnet is the outer queue which runs tasks and sonarqube needs to be one of those tasks ccnet runs.
I don't know how sonarqube runs but maybe it can be run through the exec task in ccnet. This allows ccnet to run any executable assuming sonarqube is an executable.
ccnet exec task
The docs link you posted looks like it's running something on linux. Also, the "CruiseControl" the doc page references may very well be the Java Cruisecontrol(Java CruiseControl (runs on linux))
The first thing to answer is, are you really dealing with cruisecontrol.net? Or is it actually java cruisecontrol for linux? They are different tools although they share the same origin.

Local Solution file path in CruiseControl - Can it be automated?

Ok, I know this is not a programming question.. but I'm sure its related to improving productivity of programmer.
I am trying to use CruiseControl http://cruisecontrol.sourceforge.net/ to implement continuous integration in our work flow. Each developer has separate machine to develop with.. with one centralized db server. We work mostly with Visual Studio to develop asp.net applications. And we have a centralized SVN server on the same system we're having db server.
Now I'm trying to integrate Cruise Control, but not sure what is the best way. I am particularly not able to decide...
In solution file path, do we need to pass a local path? So, in that case should we copy a one copy of project source code on server to execute? Or is there any better automated way to achieve this? Can we use SVN URL in solution file path...?
I'm sure there is must be a way to do this fully automated, but how?
In the project build node you will need to define the local path for the build server and the SVN URL so CruiseControl can grab the code from the centralized SVN server. You can use NANT or MSBuild plugin to define specific configurations for the build server to avoid mis configuration with the server. Below is an example of the ccnet.config file that need to be defined in the build server
<project name="Calculator-Service">
<schedule type="schedule" sleepSeconds="15"/>
<modificationDelaySeconds>2</modificationDelaySeconds>
<sourcecontrol type="svn">
<trunkUrl>svn://svn.mycompany.com/myfirstproject/trunk</trunkUrl>
<workingDirectory>C:\ccnetexamples\eci\working\service</workingDirectory>
</sourcecontrol>
<build type="nant">
<executable>C:\ccnetexamples\eci\working\service\tools\nant\nant.exe</executable>
<baseDirectory>C:\ccnetexamples\eci\working\service</baseDirectory>
<buildFile>nant.build</buildFile>
<targetList>
<target>ci</target>
</targetList>
<buildTimeoutSeconds>300</buildTimeoutSeconds>
</build>
<publishers>
<xmllogger>
<logDir>..\web-service\log</logDir>
</xmllogger>
</publishers>
</project>
look at
http://www.cruisecontrolnet.org/projects/ccnet/wiki/Configuration
There is a step by step guide for Build Server Scenarios.
with build script and ccnet.config examples.
IMNO, the best way to think of CC.NET is a "super fancy msbuild.exe" executor.
Write a msbuild (.proj) and put the majority of your logic in it.
Including "pull code down from svn and place it in this local directory"
Then you cc.net task will pull down this .proj file....and then use the msbuild.exe task to execute that .proj file.
Since you only have a very small amount of logic in the cc.net proprietary tasks, if you pick another CI tool, its not a hard transition.

VS2005, VSS - Check-in + Deploy automatically

I'm stuck working with VS2005 and VSS for some of the code that I'm working on. Are there any scripts that let me commit all modified source files to VSS and make VSS push out a patch to our QA servers?
Thanks,
Teja.
Have you considered CruiseControl.NET to manage your build and drop?
It sounds like you wanted a bit extra ("scripts...commit all modified source files"), but CC.NET will take care of building/reporting/deploying. It's not clear from your question where the commits will be coming from (a developer machine, somewhere else), or why automated check-ins are useful. In other words, shouldn't developers be purposefully committing code changes?
How to Setup CruiseControl.NET.
Sounds like you're looking for a Continuous Integration server, which allows you to run build scripts after detecting changes in source control. Try TeamCity or CruiseControl.NET.
Here's a walk through that details the setup process for CI with TeamCity and Subversion. You can add additional scripts for deployment via MSBuild or any command line tool.

TeamCity vs FinalBuilder Pro for Continuous Integration Server

I have seen lots of comparisons for TeamCity vs CCNet, but not much for TeamCity vs FinalBuilder Pro's CI.
Forgive me if I am not comparing apples to apples, I am familiar with TeamCity however the company I work for has already purchased FinalBuilder Pro which has a CI Server included.
I'm hoping to get some comparisons, opinions. If TeamCity does not offer more above FinalBuilder we do not want to have to support two systems.
Thanks in advance.
Here are some features present in TeamCity and unlikely present in FinalBuilder:
True client server-architecture with multiple build agents - TeamCity provides a central point of accessing and managing all of your build agents. Build agents can be enabled/disabled/restarted from single Web-UI, you can also view logs or view thread dumps of builds running on different build agents.
Support of Amazon EC for build agents grid
Pre-tested commit and remote run features (no more broken code in VCS. Well, almost :)
Integration with Visual Studio and other IDEs - a dedicated plugin for that
Extensible reporting, you can include your own HTML-based reports into build results
Comments/Pin/Tags for builds
Cross-build search
Integrated code coverage and duplicates finder for Java and .NET
FinalBuilder has support of some VCS systems, which are not supported by TeamCity, though.
Disclaimer: I'm one of TeamCity developers.
We are using TeamCity for the build orchestration, but using FinalBuilder to actually carry out the individual builds.
I love FinalBuilder for the ease of scripting and maintainability, but I also love TeamCity for all the points in KIR's answer.
In our setup, each TeamCity buildconfig is configured to use the commandline runner, and finalbuilder's fbcmd.exe is invoked with the name of a script to run.
All sweetness and light.
I have done a comparison of the 2 products for a continuous integration talk in the Uk - basically my findings were that TeamCity was more intuitive to use. FinalBuilder seemed to me to be ambigious in its language and seemed to be clunky to set up builds
Once the work was done it was a very good system - but for me TeamCity was much more intuitive and had a better user experience than Final Builder
this is very subjective though - each tool is very good. It comes down to what you are comfortable with and I was much more comfortable with TeamCity

Building ONLY Labelled Versions with CruiseControl.net or TeamCity

We're currently using CruiseControl.NET as a continuous integration server for a number of ASP.NET web projects, but we're also evaluating TeamCity.
This is working great for our build server.
What we'd like to setup is a customer facing test server. I'm thinking that when we are happy for our latest development version to be released to the client for test, we could label it in SVN.
I'd then like a second build server to build this version ready for the client to see.
The question is this - is there any way to get either CruiseControl.NET or TeamCity to build only the latest labelled version of the code in a repository?
If anyone has any alternative suggestions, that'd also be greatly appreciated!
You could have a designated location or branch in your subversion repository e.g. \release then point the second TeamCity build server at that.
When your are happy with trunk then overwrite the existing location. The second build server will pick this up, build it, and even deploy it to a test server.
I don't think there's a way to do this directly in TeamCity. You can however configure your build trigger to filter on files and/or users. So, if you touch a given file to indicate release status in addition to or rather than labelling, you can use that.
The trigger filter could be, for example (untested):
+:/ReleaseVersion.cs

Resources