Next: , Previous: Setting Properties, Up: Build Steps


4.12.11 Triggering Schedulers

The counterpart to the Triggerable described in section see Triggerable Scheduler is the Trigger BuildStep.

     from buildbot.steps.trigger import Trigger
     f.addStep(Trigger(schedulerNames=['build-prep'],
                       waitForFinish=True,
                       updateSourceStamp=True,
                       set_properties={ 'quick' : False },
                       copy_properties=[ 'release_code_name' ]))

The schedulerNames= argument lists the Triggerables that should be triggered when this step is executed. Note that it is possible, but not advisable, to create a cycle where a build continually triggers itself, because the schedulers are specified by name.

If waitForFinish is True, then the step will not finish until all of the builds from the triggered schedulers have finished. If this argument is False (the default) or not given, then the buildstep succeeds immediately after triggering the schedulers.

The SourceStamp to use for the triggered build is controlled by the arguments updateSourceStamp, alwaysUseLatest, and sourceStamp. If updateSourceStamp is True (the default), then step updates the SourceStamp given to the Triggerables to include got_revision (the revision actually used in this build) as revision (the revision to use in the triggered builds). This is useful to ensure that all of the builds use exactly the same SourceStamp, even if other Changes have occurred while the build was running. If updateSourceStamp is False (and neither of the other arguments are specified), then the exact same SourceStamp is used. If alwaysUseLatest is True, then no SourceStamp is given, corresponding to using the latest revision of the repository specified in the Source step. This is useful if the triggered builds use to a different source repository. sourceStamp accepts a dictionary containing the keys branch, revision, branch, repository, project, and optionally patch_level, patch_level and patch_subdir and creates the corresponding SourceStamp.

Two parameters allow control of the properties that are passed to the triggered scheduler. To simply copy properties verbatim, list them in the copy_properties parameter. To set properties explicitly, use the more sophisticated set_properties, which takes a dictionary mapping property names to values. You may use WithProperties here to dynamically construct new property values.