1

I am quite new to buildbot and struggling to create a configuration for the following python code structure:

A library containing some general classes and functions and two programs who depend on the one library. All three have their own git repository. Lets call the library the_lib and the programs prog_a and prog_b.

What I would like buildbot to do for me is periodically check the repositories for changes and if so rebuild what is necessary. So a change to the source of the_lib should rebuild all three, a change to the source of prog_a should only rebuild prog_a and a change to the source of prog_b should only rebuild prog_b.

I am at the point where I am able to build any of the three when its source changes but how do I introduce de dependency of prog_a and prog_b on the_lib?

Cheers, Feoh

Anshul Goyal
  • 73,278
  • 37
  • 149
  • 186

2 Answers2

0

You can trigger multiple builders with a single source change, in the following example the first two each trigger their own builds, but the third one triggers all three:

  yield basic.AnyBranchScheduler(
            name = prog_a, treeStableTimer=delay,
            change_filter = my_a_filter,
            builderNames = [prog_a],
            )

  yield basic.AnyBranchScheduler(
            name = prog_b, treeStableTimer=delay,
            change_filter = my_b_filter,
            builderNames = [prog_b],
            )

  yield basic.AnyBranchScheduler(
            name = the_lib, treeStableTimer=delay,
            change_filter = my_lib_filter,
            builderNames = [prog_a, prog_b, the_lib],
            )
David Dean
  • 2,682
  • 23
  • 34
  • Can you elaborate on the usage of yield? If you have an interesting example of dynamically generating a config, can you share the interesting bits? Thanks! – Benjamin K. Nov 18 '13 at 13:24
  • I use yield here on the assumption that you need to return these items into c['schedulers'] in your master.cfg file My master.cfg file has this line: c['schedulers'] = schedulers = list(config.schedulers.get_schedulers()) The code above is in the config/schedulers.py which is imported into master.cfg – David Dean Nov 19 '13 at 22:40
0

For the changes in the prog_(a|b) you can use a simple single branch scheduler that will call their builders.

For the_lib you have two options:

  1. Create a Dependant scheduler for the builders of prog_a and prog_b, and set the upstream scheduler as the single branch scheduler of the_lib.
  2. Configure for the prog_(a|b) a Triggerable scheduler, and trigger them using the Trigger build step from the_lib builder.
Benjamin K.
  • 1,085
  • 3
  • 15
  • 24