What tool to use for automatic nightly builds? - visual-studio

I have a few Visual Studio Solutions/Projects that are being worked on in my company, which now require a scheme for automatic nightly builds. Such a scheme needs to be able to check the latest versions from SVN, build the solutions, create the appropriate downloadable files (including installers, documentation, etc.), send e-mails to the developers upon errors and all sorts of other nifty things. What tool, or tool-set, should I use for this?
I used to use FinalBuilder a few years ago and I liked that a lot but I'm not sure if they support such features as nightly-builds and email messages.

At my work we use CCNET, but with builds on check-in more than nightly - although it's easily configured for either or both.
You can very easily set up unit testing to run on every checkin as well, FXCop testing, and a slew of other products.
I would also advise checking out Team City as an option, because it has a free version, and the reporting and setup is reportedly much simpler (it does look nice to me). It does have a limit of somewhere around 20 team members/projects, before it hits a pay-for window.
That said, we started with CCNET, and have grown several products too large to look at Team City on the free version and are very happy with what we have.
Features that help with CCNET include:
XML based configuration - you can usually copy and paste most of what you need.
More or less you'll be able to plug your treesurgeon script in as your build script, and point CCNET at that as an executable task to run the compilation.
Lots of documentation and very easy to set up nunit, ncover, fxcop, etc.
Taskbar app that will let you know the status of your projects at any time, and it can also fire off an email or keep an RSS feed with the same information.
But I'd definitely go with running a CI build on every check-in - for the most part will run the unit tests before checking in, but let the CCNET server handle run any applications/assemblies that would have dependencies on the assembly we're checking in, and they get re-built, and re-tested on every checkin.
Given that CCNET is free free and takes very little time to set up - I'd highly recommend just going for it and seeing if it suits you, then expanding from there.
(There's another thread here where I posted pretty much the same/with a few alterations - but some of the other comments may help too! Automated Builds)
Edit to add: You can easily set up your own deployment scheme for CCNET, and there are a tonne of blog posts out there to assist, and email notifications can really be set up fairly granularly, either on all successes, all failures, when it changes from success to fail, etc. There's also built in RSS, and you could even set up your own notifiers for other systems.

FinalBuilder does support emailing and just executing FinalBuilder each night will give you nightly builds. You don't really need other software for that if you don't want to.
You could also use CCNet to trigger a build when needed and have it execute FinalBuilder for the build. You can then decide if FinalBuilder or CCNet should email.
Finally FinalBuilder has a Server version which is sorta like CCNet in that it is a continues integration tool using FinalBuilder. See http://www.finalbuilder.com/finalbuilder-server.aspx
Of course the biggest advantage of CCNet is that it is free and open source.

Although it costs, I highly recommend Visual Build. It works with MSBuild, and old tools like Visual Basic. It is scriptable, and can do everything from making installers to simple Continuous Integration.

We just started using Hudson here at the office.
Its free and open-source, it has a very user friendly UI. Plus there are tons of options and plugins available.
I was up and running in a matter of minutes after installing it. All the other devs here are loving it.
All in all, its a very elegant solution for Continuous Integration or Nightly Builds.

I've recently started using CruiseControl.NET (http://confluence.public.thoughtworks.org/display/CCNET/Welcome+to+CruiseControl.NET). It works reasonably well, although configuration could be easier. CruiseControl.NET is free and open source, and seems to integrate with most standard tools, although I've personally only used it with CVS, SVN, NUnit and MSBuild.

Luntbuild
Supports a wide variety of source control and build systems. Very customizable. Open Source. Setup takes some time, but it's not too horrible.

Buildbot is open source and very powerful too. You should take a look at it.

Cascade supports doing a build on every single change committed to the repository.
I would not recommend doing only nightly builds -- that's a pretty long window where a build break can slip in before it's reported.

Related

How to do continuous integration for c# application?

Can anyone advise what is the equivalent of hudson for c# application?
I used to use hudson as a build server for java performing auto deployment for java web and batch job application at scheduled timing and email notify technical team
I like to ask how can i do the same for c# application.
And is there any standard plugins like static code analysis tool in the build server which i can used to scan through the codes
In addition to the great tools mentioned by jamesj, TeamCity works pretty well too. I prefer it to CruiseControl, from a configuration usability perspective, and it is free given you stay within certain constraints.
If you've already invested in TFS as a source control, though, make sure you are getting your money's worth and use it for your builds and deployments too.
If you like Hudson, take a look at Jenkins. I've seen folks using it for .NET builds as well, though I haven't personally used it, and according to their page Jenkins used to be called Hudson, so it would probably be familiar to you.
TFS is great for continuous integration, but you can also use CruiseControl.NET with NAnt. Both of these should be able to run batch jobs, send emails and run automated deployments
StyleCop and FxCop both do static checking and both can be integrated into your build process.

Build automation for Delphi + Oracle

at my work we are presently looking for a automated build tool. We have googled quite a bit, but there are so many possibilities we are not sure which tool is the best option, to be honest.
We are not even sure there is one that fits our needs. It should have as many as possible from following features:
Integration with Subversion, meaning it should be able to do both updates and commits.
Diff tool or ability to integrate with one, and capability of auto-merging files (well, at least not the problematic ones).
Delphi build automation, using the command line compiler.
Integration with Oracle, meaning having the ability to run SQL scripts and compiling PL/SQL packages, functions, etc.
Sending of e-mails with build status (I guess this is something all of them have).
Additional functionalities would be welcome but are not needed at the moment. Anything in the line of getting at least points 1 and 2 would be great.
If anyone could point us to some particular tool we would be very grateful.
Thanks in advance and best regards
For my Delphi projects, I was using FinalBuilder (itself a Delphi app) way back when. I was always very happy with the product, and it worked very well.
In the meantime, they also launched a Server version of the build tool, so you can set up a full build server and have your code built there.
Another worthy contender back in those days used to be Visual Build - feature by feature the two almost match up, but the "feel" of the app, the ease of use, was with Finalbuilder, in my personal opinion.
I'm not sure if any of the two has direct and specific Oracle support, but at least Finalbuilder can run anything that can be run from the command line, so that should give you plenty of options, really.
I've been using CruiseControl.NET as a Continuous Integration server for our Delphi builds, which integrates quite nicely with NAnt as a build scripting language.
Forgetting about CC.NET, simply using NAnt would provide most/all of what you need, I think.
Combined with the extra NAnt-Contrib library of extra tasks, I have implemented everything you mention with the exception of the Oracle integration. However, you can easily invoke commandline stuff from within NAnt scripts, or write your own NAnt tasks using any .NET language.
NAnt has tasks for integrating with Subversion, or you can simply invoke the svn command line client.
I have invoked BeyondCompare as a diff tool from within my NAnt scripts, used NAnt to send customised HTML emails and execute Installshield builds, along with obviously executing the commmand line Delphi compiler and resource compiler.
NAnt is free and open-source, it's worth checking out.
Check also Automated Build Studio from AutomatedQA, it has many of the features you ask for.
We use FinalBuilder to handle requirements 1, 3, 4 and 5 and Beyond Compare to handle requirement 2 and have been very happy with both of these tools.
Apache Ant is open source and contains many tasks out of the box, and a very feature complete scripting and dependency management environment.
Subversion integration add-on: subclipse
SQL core task is included
Apply task can run any executable on any file pattern (like *.dpr)
Mail task included
Diff Patch task included
Also available: zip/unzip, tar/untar, xmlvalidate, xslt, ftp, telnet, scp, sshexec, cab, ...
I'm surprised no one has mentioned Hudson. Most build tools seem to target a specific language or platform. Hudson takes a different approach. It provides a plugin architecture so you can create a build server that fits your needs. The project itself is written in Java but is entirely self contained (with the exception that it depends on the JRE of course). It uses its own built-in web server to provide a user interface.
Embarcadero uses Hudson extensively and there are several great how to articles to get you started
http://christerblog.wordpress.com/2010/04/25/using-hudson-to-build-delphi-projects/
http://www.nickhodges.com/post/Getting-Hudson-set-up-to-compile-Delphi-Projects.aspx
And if you need commercial support the original author has started a company that provides a custom version as well as technical support.

What does CruiseControl (or any other CI tool) give more than well-written (n)Ant?

We have a large collection of nAnt scripts that build our various products. They almost all have the following structure:
Erase old working copy.
Check out complete fresh copy from version control.
Increment build number in appropriate file (custom nAnt task).
Run static analysis (StyleCop, Perl scripts)
Build solution using Visual Studio - ends up with MSI output.
Run unit tests (nUnit, JSUnit)
Run static analysis (FxCop)
Zip up deliverables (MSI, readme, etc) into well-named package.
Put this zip package onto a server share.
Email results to team.
From our research, it seems that CruiseControl(.net?)/Hudson/BuildBot would only add the trigger that causes the build, which at the moment is double-clicking the nAnt script over Remote Desktop and a status dashboard.
Are we missing anything else significant?
The question is subjective, and thus so is my answer.
In the projects I've automated before, CruiseControl was used essentially for that one purpose: so we didn't have to remote into the build machine and trigger builds. The CI part is that CruiseControl will monitor the repository for you, triggering builds at the intervals you define.
It also gave us the dashboard from which could trigger releases, or go back to examine logs and artefacts from past builds.
For us that was enough benefit to implement CruiseControl. Perhaps it doesn't "seem" like much until you've finished it and a month later realized you haven't had to touch your build system because it's off silently and thanklessly doing its thing for you.
A Continuous Integration server such as Hudson would do 1, 2, 3, 9 and 10 for you so that you don't have to implement them yourself. If you've already got it working that's maybe not a huge improvement for your current project but it makes things simpler for subsequent projects. It would also, as you mention, take care of when to trigger the build.
Hudson will also chart various trends over time, such as test coverage, build time, static analysis results. You can also have more sophisticated notifications than just e-mail if you choose.
The most important thing it gives you is visual feedback (the bigger the screen is better). When you have one machine, dedicated to displaying buildresults, visible to all team members, it works like a catalyst to people see that something is wrong and fixes it.
If you have something like that standing in a place where your boss can see it and ask you "Hey Wilkinson, why is this screen red?" will you fix your build faster?
Thay all look the same, you can pick whatever you think fits your needs, just have one setup and running.

Infrastructure required for TDD?

I am 'relatively new' to unit-testing and TDD. Only more recently have I completed my first production application that has (at least in theory) 100% code coverage. I have done unit-testing in previous projects as well for some time, but not in true TDD fashion and with good code coverage. It had always been an after-thought. I feel I have a pretty good grasp on it now though.
I'm also trying to train the rest of the team on TDD and unit testing so that we can grow togeather and start moving forward with doing unit testing in all of our applications, and eventually progress to doing full TDD w/ automated builds & continous integration. I posted a thread here regarding my plan of attack / training agenda for comments & critisism.
One of the replies (in fact the highest voted) suggested I first setup infrastructure before I go forward with the training. Unfortunately I have no exposure to this, and googling on the topics is difficult because the pages for CruiseControl.NET / nAnt / etc do not really explain the 'why' we should set this up and the 'how' everything connects togeather.
We are a small shop (about 10 developers) and use almost exclusively microsoft technologies and do our development in VB.NET. We are looking to eventually start using C# but that's for another time. I've been using the MSTest project that comes with VS2008 for my unit tests, and I've been building my apps using Visual Studio, and deploying using MSI setup projects... We also (unfortunately) use VSS for our soure control - but that is also on the chopping block and I'd really like to get rid of it and use subversion.
I know that I need to use CruiseControl.NET for CI, and either nAnt or MSBuild for building the applications. And I probably need a build server to run all these builds. But I just can't find anything that 'connects' the dots and explains how they interact with eachother, what should be on your build server, when you should build with your build server (is it just for deployment builds, or even when you just want to compile the app you're developing after making a small change, on your local environment?). I'm also planning on axing MSTest as I've found it to be buggy and will use nUnit instead.
Can anyone perhaps illuminate this gap I have from 'knowing how to do TDD' to 'setting up the proper infrastructure so the whole team can do it and work togeather'? I do understand what continous integration is, but again, I'm not sure how a build server should be setup and how it connects with everything, and why we need one (e.g. the pitch to management).
thanks very much for your time.
What portion of finalbuilder do I need? It seems there's some overlap with final builder and teamcity. Finalbuilder server seems to be a CI server, so I'm guessing I don't need that. FinalBuilder seems to be a build server - but I thought TeamCity is also a build server... And Automise seems to be a visual windows automation tool, like some kind of development platform for winforms apps...
_I also don't see support for final builder in The Team City Supported Apps Diagram : _
Take a look at a webinar I did a few weeks ago - How To Start Unit Testing Successfully. In that webinar I've talked about tools and unit testing best practices and it was aimed at developers just like you who want to introduce unit testing in their organization.
First order of business you want to put a CI (Continuous Integration) process in place and for that you'll need three tools:
Source control
Build server
Build client/script
I hope you already have some form of source control in place so let's talk about the other two.
Build Server - checks the source control and when it changes (or some other condition met) runs a build script on some client (or same machine) there are several build server available I recommend JetBrain's TeamCity it's easy to install and use (great web interface) and is free for up to 20 developers (that's you).
Build Script - on your build client you want to run a build script that would build your solution and run your unit tests. TeamCity has some basic build & test capabilities but for more advanced options (build installer, documentation etc.) you'll need some script runner at work we use FinalBuilder - it's not free but has very good editor. If you're looking for a free alternative have a look at ANT or NANT - but be prepared to edit a lot of XML.
Other tools - Because an important part of successful unit testing is how easy it is to write and run tests on the developer's machines I suggest you check if there are better IDE's or external tools that would help the developers write & run their unit tests.

how to automate or facilitate multiplatform build/test before committing?

Our software is built on linux and windows platforms. Depending on the preference of the developer a contribution is developed and tested on either platform and then committed to our subversion repository. It then turns out that the contribution doesn't build on the other platform, and a fix has to be made. The fix on the other platform may again break the build on the original platform, and so on.
I'd rather see that a contribution is built (and regression tested) on the other platform as well before being committed. We have a continuous build server (CruiseControl), but that server builds from the repository. I am looking for a solution where the continuous build server builds on the other platform as a pre-commit check and then commits the stuff if the build and test succeed.
Any suggestions?
Teamcity handles pre-tested commit, you may be able to do something with the new build chaining features in 4.0( http://www.jetbrains.com/teamcity/features/newfeatures.html ). Agents are cross platform and can be configured to only run particular bits of the build, so could possibly be configured to only run a subset of tests.
Note that I haven't actually done this :)
It might be easier to have two branches, one where people checkin, and another which they merge their changes into after they have passed continuous integration.
Matheiu Godlewski has made a good suggestion at the CruiseControl wiki
If you combine his suggestion with the veto element, I think you should be set.
We used a custom build and test rig that could remotely deploy to multiple OSes (and multiple Database products on multiple OSes). This was done as a nightly build with a rule that you fix your bugs the next morning.
No entirely continuous then, but that's potentially a lot of work to do on a pre-commit hook. Especially if your source control repository locks the affected files for the duration of the pre-commit hook execution.
I think there's a difference between a continuous integration test that runs during the day, per-commit, and a system integration test that runs nightly.
Douglas Leeder suggested an "integration" branch - the nice thing about it is that it's possible to automate. If the tests pass - merge to the 'trunk'.
Some version control systems (e.g. bzr/hg/git) make this easier than others, but it's possible on most.

Resources