It is common to wind up with one kind of build which should only be performed if the same source code was successfully handled by some other kind of build first. An example might be a packaging step: you might only want to produce .deb or RPM packages from a tree that was known to compile successfully and pass all unit tests. You could put the packaging step in the same Build as the compile and testing steps, but there might be other reasons to not do this (in particular you might have several Builders worth of compiles/tests, but only wish to do the packaging once). Another example is if you want to skip the “full” builds after a failing “quick” build of the same source code. Or, if one Build creates a product (like a compiled library) that is used by some other Builder, you'd want to make sure the consuming Build is run after the producing one.
You can use “Dependencies” to express this relationship
to the Buildbot. There is a special kind of Scheduler named
scheduler.Dependent that will watch an “upstream” Scheduler
for builds to complete successfully (on all of its Builders). Each time
that happens, the same source code (i.e. the same
will be used to start a new set of builds, on a different set of
Builders. This “downstream” scheduler doesn't pay attention to
Changes at all. It only pays attention to the upstream scheduler.
If the build fails on any of the Builders in the upstream set,
the downstream builds will not fire. Note that, for SourceStamps
generated by a ChangeSource, the
revision is None, meaning HEAD.
If any changes are committed between the time the upstream scheduler
begins its build and the time the dependent scheduler begins its
build, then those changes will be included in the downstream build.
See the see Triggerable Scheduler for a more flexible dependency
mechanism that can avoid this problem.
The keyword arguments to this scheduler are:
from buildbot.schedulers import basic tests = basic.Scheduler("just-tests", None, 5*60, ["full-linux", "full-netbsd", "full-OSX"]) package = basic.Dependent(name="build-package", upstream=tests, # <- no quotes! builderNames=["make-tarball", "make-deb", "make-rpm"]) c['schedulers'] = [tests, package]