Bamboo CI and Git Branches

On the off chance that Google even indexes my blog anymore, I thought I’d write a short post about an issue we resolved with Bamboo and Git branches last week that doesn’t seem to be documented anywhere. We are using Bamboo to do continuous building (we’re not doing continuous integration because we use feature branches – that’s a topic for an entirely different post). Last week, we needed the branch name to create packages for the build artifacts. The Bamboo documentation doesn’t have anything related to git and branch name though it does say that ${repository.hg.branch} will get you the branch if you’re using Mercurial.

As it turns out, if you prefix the variable with bamboo, things start working. As in ${bamboo.repository.git.branch}. This successfully returned the branch name. As far as I can tell, this isn’t in the Bamboo documentation anywhere so it can live here for posterity (or obscurity, whichever).

Successful Configuration Management Using Git

I am just beginning to play around with Git and so far I’m pretty happy with it. One thing I love about it is that the concept of branching is just part of the model. Branching is critical to successful software configuration management (SCM) and it’s a topic that strikes fear into the heart of any developer who has never done it. The idea of having all these branches that you have to eventually merge and bugs to fix and AAAAHHHHHHH!

Sigh. Of course this comes from the fact that most of our SCM tools have been craptacular at dealing with branches and merging. This craptacularness is built in to most of them because of the centralized server concept (though Perforce is spectacular, the opposite of craptacular, at branching and merging). On top of that, most Microsoft developers first and often only exposure to SCM is SourceSafe which is like driving a Pinto for your entire life. SCM in a robust environment is necessarily complex but it doesn’t have to be impossible and using the right tools changes the game. The new distributed source control tools like Git and Mercurial (which I have a soft spot for since it’s written in Python) are the future of decent development practices.

All this comes from reading a great article detailing how to use Git successfully to manage software development. The author details exactly how his team has been using Git to successfully branch and manage software changes. I haven’t begun to need all the ideas that his team is using but I hope to one day. Plus I thought my audience of 4 might find it useful.