5

Is it possible to have more than one source checkout step in BuildBot? I can't find any explicit documentation of this, but it appears that doing a source checkout in BuildBot also changes the current working directory to the checkout directory, which means it's unclear where one would "go" to checkout from another repository and then run a script that uses both.

Consider the example at http://buildbot.net/buildbot/docs/0.8.1/BuildFactory.html:

From the steps, it appears that a CVS checkout is performed and then make build is run. That is two steps in BuildBot, which is convenient.

However, if you were do to the equivalent from the command line, it would be three steps:

cvs co $CVSROOT
cd directory_that_was_created
make build

Where does the cd directory_that_was_created step happen in BuildBot?

But more importantly, what if I want to have two source.CVS (well, really source.Git) steps? What directory am I in after I run the second step? Does the second repo end up in a subdirectory of the first repo?

With Git, it seems like I could make one a submodule of the other to ensure that they would both get checked out in one step, though I would prefer not to do that, if possible.

bolinfest
  • 3,710
  • 2
  • 27
  • 40

1 Answers1

4

OK, I figured this out. I did not realize that there is the concept of a "workdir" associated with each step that indicates where the "work" happens. The default workdir for all steps is a directory named build.

On http://buildbot.net/buildbot/docs/latest/manual/cfg-buildsteps.html under Source Checkout -> Common Parameters -> workdir, it does acknowledge that source steps are special "in that they perform some operations outside of the workdir (like creating the workdir itself)."

This explains why there is no explicit step that corresponds to a cd command in my above example. To solve my problem, I created two Git steps, each with its own workdir value. This is followed by subsequent ShellCommand steps that call into the appropriate directory, knowing that the two workdir directories will be siblings of one another.

bolinfest
  • 3,710
  • 2
  • 27
  • 40
  • 1
    Actually, this does not work if you use a scheduler that runs in response to a particular commit hash. In that case, both Git steps try to checkout at the same hash, which exists in one repo but not the other. I ended up running `git clone` in a `ShellCommand` instead. If `Git` made it possible to specify to always checkout from head, regardless of what the scheduler says, then I would not have to do this. – bolinfest Aug 31 '12 at 18:29
  • this issue can be avoided by specifying `alwaysUseLatest=True` in the buildstep of the secondary repository, avoiding an attempt to use the other repos' sourceStamp. – alanc10n Nov 15 '16 at 22:52