Search code examples
gitbuildbot

How do I use copy mode when checking out multiple git repositories in buildbot


I have multiple git repositories to have some interdependencies between them. I need to check all of them out when doing a full system build.
With buildbot, I can use the mode='clobber' parameter to the Git source class constructor, but this causes all of the repositories to be checked out each time:

factory.addStep(Git(repourl='ssh://build@build/repo1', mode='clobber', workdir='build/repo1'))
factory.addStep(Git(repourl='ssh://build@build/repo2', mode='clobber', workdir='build/repo2'))
factory.addStep(Git(repourl='ssh://build@build/repo3', mode='clobber', workdir='build/repo3'))

I would like to use mode='copy', but when I do that, the source for all three repositories gets checked out in the same location, eg. .../source/ rather than .../source/repo1 .../source/repo2 .../source/repo3

Is there a way to indicate to buildbot to keep clean copies of each repository separately?

Thanks in advance!


Solution

  • With buildbot 0.8.5 and above, you can use the new master-side source steps (which live at buildbot.steps.source.git.Git instead of builbot.steps.source.Git) and then Git(..., mode='full', ...) will do a checkout plus git clean -xfd.

    Also, there is work under way to properly support for using code for multiple sources, that will be included in buildbot 0.8.7, when it is released.