views:

1232

answers:

10

As recently as several years ago, the developers actually made the builds that went to clients. This was obviously a disaster for reasons too numerous to list.

Then when we started to learn the errors of our ways, we looked for a way to auto-build the entire application on a dedicated build machine. The culture at that time was very averse to bringing in outside tools, so we built our own autobuild system by writing a VB app.

This worked fine for a while, until the project's structure started to change, new projects were added, and we needed to build the application in different ways. Then then weaknesses of our hand-rolled autobuilder became apparent and, over time, increasingly onerous. This disease has progressed now to the point where QA (who owns our build process) can't even maintain the autobuilder because it requires more and more programming skill. Every time we add a project or change something in an existing project, it consumes more developer time just to make it work. There have been days when we were unable to produce a build because the system was broken.

I'm now in a position where I can change this process, and I'm looking to scrap the entire system and put something else in it's place. My goals are:

  • Have an autobuild system that can run with zero human interaction at a specific time every day. It should be able to gather all the source code, compile all the apps, create the setups, put the finished products on a network share, and possibly trigger the automated testing system to kick in (we use QTP).
  • The autobuild system should be flexible enough to easily adapt to changes in the project without rrequiring a major overhaul.
  • It should be simple enough so that QA can own the system and not require developer resources to make changes to how builds are made.

What are your experiences? Can you recommend an autobuild system? Should I have different goals?

+5  A: 

I'm currently using CruiseControl integrated with Ant to control project builds. This allows flexibility of build schedules and means you can automate the entire build process fairly easily using Ant scripts. Also, during defect fixing periods you can have CruiseControl set up to watch for source control submissions instead of time periods and build when these occur. This allows developers very quick feedback on defect fixes.

workmad3
+1 for Cruise Control, I moonlight as my company's build engineer and I use it for nightly builds (about 300+ handsets over multiple products) and also use it for Release builds.
omermuhammed
Iconically, I've now switched to Hudson :) IMO, it's much more polished than CC and much easier to set up different project types on.
workmad3
+1  A: 

As of tools delivered with MS Visual Studio you might want to use MSBuild. Additional Community toolsets for MSBuild will even give you the possibility to checkout code from Subversion and zip output.

We're using it successfully in our company. Projects consists of several solutions with 100+ subprojects. Works like a charm.

Marcin Gil
+1  A: 

Visual Build Pro is nice, if your build machines are Windows. I think this would fill the requirement you have about QA owning the system. But don't get me wrong, it's pretty powerful.

Aardvark
+4  A: 

Definitely look into MSBuild if you're on the Microsoft stack.

Joel is always going on and on about how great FinalBuilder is, so that might be worth a look as well.

Jeff Atwood
+4  A: 

We just migrated from a hand-rolled set of Perl scripts to a Buildbot setup. I found it because that's what Google's using for Chrome.

You can do nightlies, or it can integrate with source control to do an isolated test build whenever anybody does a checkin, or a variety of other things. It's also parallel; you can have more than one machine in the build farm, either for specialized duties or just to handle more load.

The entire system is written in Python, so it's platform-agnostic, which is important if you need to do builds on more than one platform. It can do anything you can do from the command line; we have it calling MSBuild for user-mode components, a DDK build for kernel-mode pieces, and running products for unit test builds.

Out of the box it supports most OSS source control tools, but if you're using TFS or something else you may need to modify the package that you install on the slave machines.

Ben Straub
+1 for buildbot! I switched from Cruise Control to BB recently, the advantages are many (easier config, keeps track of arbitrary log files, easy debugging, comical IRC control bot...)
rq
+2  A: 

I think you are on the right track here.

Whoever looks after your automated build process needs to have a fundamental understanding of how your solution fits together. This doesn't necessarily mean knowing how to write code or architect solutions, but they will require a solid understanding of how the solution compiles, packages itself etc.

You might need to share responsibility for builds between people or teams to accomplish this. I'd say that a daily build is a "team responsibility".

I'd look at establishing a baseline build configuration which can be extended for "special use" builds (besides just building a release version), e.g. internationalized releases, fxCop/Quality Tools config, build + run Unit Tests, continuous integration builds, a build config to run on developer workstations, etc.

Instead, I'd aim to achieve the following:

  • Automatic versioning, signing etc
  • Ability to produce verbose output (logging) to help debug build breaks
  • On that point - it should handle errors properly, capture as much information and log it properly
  • Consistency - It should work the same way each time to produce repeatable outcomes
  • Run in a clean, limited access environment
  • Well commented/documented so that it can be understood by new staff, etc.
  • Option to generate release notes, compile metrics, produce reports (if this option is available)
  • Ability to deploy to multiple environments
  • Support different ways to obtain source code from source control, e.g. by changeset, label, date, etc
  • As for tool recommendations, I've used FinalBuilder, Visual Build Pro, MSBuild/Team Build, nAnt, CruiseControl and CIFactory plus and good old fashioned batch files.

    Each has its pros and cons, I'm not going to make a recommendation except to say that the products with decent UI support were a little bit easier to work with, but at times were far less powerful. If you're working with VIsual Studio, MSBuild is very powerful, but has a somewhat steep learning curve.

    RobS
    Good answer, but I really wish you'd included a few more pros and cons as you see them, as you seem to have had used a good range of tools. +1
    JV
    +6  A: 

    I use FinalBuilder and FinalBuilder Server for nightly builds. It's a bit buggy at times, but if you think it through it's quite easy to create extensible projects that can build X project type, build it's database from change scripts and deploy it to a testing server.

    It can also handle all kinds of wierd and wonderful things like ZIPing a nightly build and uploading it to an FTP or creating ISO images automatically.

    Steven Robbins
    A: 

    Thank you all for your comments so far -- you have given me some great stuff to look in to.

    I have a follow-up question based on a couple of the replies. I'm not exactly sure how this is supposed to work on SO, so I'm just going to ask it here. If there's another way that follow-ups are supposed to work, please feel free to leave me a comment.

    My follow-up question is this: What are your thoughts on QA owning the auto-build system? I mean, I know that it's a team effort and even if QA owns the system they will still need to rely on resources from other departments to get the job done, but someone -- or some department -- has to be singly and ultimately responsible for the autobuild. Should that be QA? Development? Someone else?

    John Dibling
    I think you're expected to ask a separate question. Could always cross-link the two if they are related.
    Jeffrey Fredrick
    ferventcoder
    +1  A: 

    We use CruiseControl.NET and UppercuT (which uses NAnt) to do this. UppercuT uses conventions for building so it makes it really easy for someone to get started by answering three questions (What is the solution named? What is the path to source control? What is your company's name?) and you are building.

    http://code.google.com/p/uppercut/

    Some good explanations here: UppercuT

    ferventcoder
    A: 

    We use the Hudson buildbot for for big Java web app building from ant build scripts. Hudson is pretty sweet for our purposes. It has a master/slave setup so builds can be done concurrently (on a timer or on-demand). Slave nodes can be any OS/hardware combo provided it has the needed build tools already on it and is on the network (and won't crash every 10 min).

    Full web-based interface including live console output, change logs, artifacts from the build are available across the network including previous builds (if successful). Awesomesauce!

    ExitToShell