Search code examples
buildbot

Buildbot Triggerable Scheduler and working dir relation


Trying to setup a Triggerable Scheduler in buildbot nine (0.9.1) but I think I'm misunderstanding how this is supposed to work. I have two builders:

  • CompilerBuilder
  • PackageBuilder

Last step of the CompilerBuilder is a trigger step:

steps.Trigger (schedulerNames=['package'],
               waitForFinish=True)

The master configuration file has a Triggerable scheduler:

c['schedulers'].append(schedulers.Triggerable(
    name="package", 
    builderNames=['package']))

What I want to achieve/expect

  • A SingleBranch Scheduler starts the CompilerBuilder
  • When the CompilerBuilder reaches the last step, the PackageBuilder is triggered, so the freshly compiled software is packaged.

What really happens

  • The SingleBranch Scheduler starts the CompilerBuilder
  • When the CompilerBuilder reaches the last step, the PackageBuilder is triggered

...so far so good, unfortunately the PackageBuilder is started inside a different working dir from the one where the code has been checked-out and compiled, so the package creation process fails.

My understanding was that a Triggered builder would be run in the same working dir of the "calling" builder but I think I'm not understanding how to correctly configure the builders/schedulers correcty.

Any hint?


Solution

  • Unfortunately, each builder has it own working directory. I recommend using addSteps (not addStep) with a list of package steps as part of the single branch scheduler builder. If you don't always want to package, add a doStepIf with some additional logic.