A workaround for the missing git submodule support in Bamboo 3.1

  • Christian Stocker

Atlassian's Bamboo (which we use for Continuous Integration here at Liip) has built-in git support since 3.0, but unfortunately, even in version 3.1, that doesn't support git submodule. It's now scheduled for 3.2 ( see this issue), but they already promised that for 3.1, so let's see if it actually happens (sometimes I have the impression Atlassian prefers to build shiny new features than to fix the existing ones which is a little bit frustrating)

The major problem with the missing submodule support is that you can't even clone a project, when it has submodules. It just fails with an error. So you can't just update the submodules with a script after the clone/update. Major headache. But I found a workaround. Not a nice one, but it works – as long as your submodules don't change too often.

Just call this script before you start the next build:

#!/bin/bash
BUILDDIR=${bamboo.build.working.directory}
REPOURL='git://gitrepo.example.com/path.git"
rm -rf $BUILDDIR
git clone $REPOURL $BUILDDIR
cd $BUILDDIR
git submodule init
git submodule update

From now on, Bamboo will check for updates and start the tests, as it normally would, until …

The major problem is that you have to do that every time your submodules change. If they change, the checkout of Bamboo will fail and no tests will be run anymore. One could maybe automate that somehow (outside of Bamboo), but I leave that as an exercise for the reader :) Until such a solution exists, you have to start it manually. Every. Time. A. Submodule. Changes.

BTW, you have to figure out what ${bamboo.build.working.directory} is in your Bamboo installation, you can usually find it eg. at http://bamboo.liip.ch/build/viewBuildFiles.action?buildKey=SF-CORE-PHPUNIT (replace the build-key and domain name with your settings), if your logged in and an admin.

It's just a dirty, manual-involvement-needed workaround, so I sincerely hope Atlassian builds support for submodule soon into Bamboo. You can vote for the issue BAM-8106, maybe that helps to get it more attentions.

And yes, we know there are alternatives and we're continuously (pun intended) looking into them, as well


Tell us what you think