Pages

Tuesday, April 13, 2010

Using GIT in a CI System -- The Smart Way

Yes, there is a big hype around DVCS system such as GIT, Bazaar or Mercurial. Especially GIT has extremly fast operations for switching branches etc.

There is a very cool chance to use this git feature in your Continuous Integeration (CI) system if you have a big fat codeline with many branches whichare build in parallel.

Let's assume our CI system uses a build grid with a bunch of build agents which are running on a at multicore system (or several of them if you are lucky ;).

Given a build agent multicore machine and a git repo, use one "master" git repository clone which is responsible to fetch all changes. Every build agent has its own working copy git repo which references the object store of the master repo.
When a build is triggered, then perform the following steps: (a) fetch the changes in the master repository, and (b) perform a "git checkout" for the build agent working copy git repo.

This will be extremely fast. This smart git checkout can be in the order of 10-50 milliseconds rather than several minutes -- which can speed up your CI builds dramtically.

1 comment:

  1. To the best of my knowledge, no CI system implements this idea so far.

    ReplyDelete