Sophie

Sophie

distrib > Fedora > 15 > i386 > by-pkgid > 3f9ebee8620943b09026c8db6c1492ff > files > 107

buildbot-doc-0.8.5p1-1.fc15.noarch.rpm



<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    
    <title>Schedulers &mdash; Buildbot v0.8.5rc2-29-g80a524b documentation</title>
    <link rel="stylesheet" href="../_static/agogo.css" type="text/css" />
    <link rel="stylesheet" href="../_static/pygments.css" type="text/css" />
    <script type="text/javascript">
      var DOCUMENTATION_OPTIONS = {
        URL_ROOT:    '../',
        VERSION:     '0.8.5rc2-29-g80a524b',
        COLLAPSE_INDEX: false,
        FILE_SUFFIX: '.html',
        HAS_SOURCE:  true
      };
    </script>
    <script type="text/javascript" src="../_static/jquery.js"></script>
    <script type="text/javascript" src="../_static/underscore.js"></script>
    <script type="text/javascript" src="../_static/doctools.js"></script>
    <link rel="shortcut icon" href="../_static/buildbot.ico"/>
    <link rel="top" title="Buildbot v0.8.5rc2-29-g80a524b documentation" href="../index.html" />
    <link rel="up" title="Configuration" href="configuration.html" />
    <link rel="next" title="Buildslaves" href="cfg-buildslaves.html" />
    <link rel="prev" title="Change Sources" href="cfg-changesources.html" /> 
  </head>
  <body>
    <div class="header-wrapper">
      <div class="header">
          <p class="logo"><a href="../index.html">
            <img class="logo" src="../_static/header-text-transparent.png" alt="Logo"/>
          </a></p>
        <h1><a href="../index.html">Buildbot v0.8.5rc2-29-g80a524b documentation</a></h1>
        <div class="rel">
          <a href="cfg-changesources.html" title="Change Sources"
             accesskey="P">previous</a> |
          <a href="cfg-buildslaves.html" title="Buildslaves"
             accesskey="N">next</a> |
          <a href="../py-modindex.html" title="Python Module Index"
             >modules</a> |
          <a href="../genindex.html" title="General Index"
             accesskey="I">index</a>
        </div>
       </div>
    </div>

    <div class="content-wrapper">
      <div class="content">
        <div class="document">
            
      <div class="documentwrapper">
        <div class="bodywrapper">
          <div class="body">
            
  <div class="section" id="schedulers">
<span id="id1"></span><h1>Schedulers<a class="headerlink" href="#schedulers" title="Permalink to this headline">¶</a></h1>
<p>Schedulers are responsible for initiating builds on builders.</p>
<p>Some schedulers listen for changes from ChangeSources and generate build sets
in response to these changes.  Others generate build sets without changes,
based on other events in the buildmaster.</p>
<div class="section" id="configuring-schedulers">
<span id="id2"></span><h2>Configuring Schedulers<a class="headerlink" href="#configuring-schedulers" title="Permalink to this headline">¶</a></h2>
<p id="cfg-schedulers">The <a class="reference internal" href="#cfg-schedulers" title="schedulers"><tt class="xref bb bb-cfg docutils literal"><span class="pre">schedulers</span></tt></a> configuration parameter gives a list of Scheduler
instances, each of which causes builds to be started on a particular set of
Builders. The two basic Scheduler classes you are likely to start with are
<tt class="xref py py-class docutils literal"><span class="pre">SingleBranchScheduler</span></tt> and <tt class="xref py py-class docutils literal"><span class="pre">Periodic</span></tt>, but you can write a
customized subclass to implement more complicated build scheduling.</p>
<p>Scheduler arguments should always be specified by name (as keyword arguments),
to allow for future expansion:</p>
<div class="highlight-python"><div class="highlight"><pre><span class="n">sched</span> <span class="o">=</span> <span class="n">SingleBranchScheduler</span><span class="p">(</span><span class="n">name</span><span class="o">=</span><span class="s">&quot;quick&quot;</span><span class="p">,</span> <span class="n">builderNames</span><span class="o">=</span><span class="p">[</span><span class="s">&#39;lin&#39;</span><span class="p">,</span> <span class="s">&#39;win&#39;</span><span class="p">])</span>
</pre></div>
</div>
<p>There are several common arguments for schedulers, although not all are
available with all schedulers.</p>
<dl class="docutils">
<dt><tt class="docutils literal"><span class="pre">name</span></tt></dt>
<dd>Each Scheduler must have a unique name. This is used in status
displays, and is also available in the build property <tt class="docutils literal"><span class="pre">scheduler</span></tt>.</dd>
<dt><tt class="docutils literal"><span class="pre">builderNames</span></tt></dt>
<dd>This is the set of builders which this scheduler should trigger, specified
as a list of names (strings).</dd>
</dl>
<dl class="docutils" id="index-0">
<dt><tt class="docutils literal"><span class="pre">properties</span></tt></dt>
<dd><p class="first">This is a dictionary specifying properties that will be transmitted to all
builds started by this scheduler.  The <tt class="docutils literal"><span class="pre">owner</span></tt> property may be of
particular interest, as its contents (as a list) will be added to the list of
&quot;interested users&quot; (<a class="reference internal" href="concepts.html#doing-things-with-users"><em>Doing Things With Users</em></a>) for each triggered build.
For example</p>
<div class="last highlight-python"><div class="highlight"><pre><span class="n">sched</span> <span class="o">=</span> <span class="n">Scheduler</span><span class="p">(</span><span class="o">...</span><span class="p">,</span>
    <span class="n">properties</span> <span class="o">=</span> <span class="p">{</span> <span class="s">&#39;owner&#39;</span> <span class="p">:</span> <span class="p">[</span> <span class="s">&#39;zorro@company.com&#39;</span><span class="p">,</span> <span class="s">&#39;silver@company.com&#39;</span> <span class="p">]</span> <span class="p">})</span>
</pre></div>
</div>
</dd>
<dt><tt class="docutils literal"><span class="pre">fileIsImportant</span></tt></dt>
<dd>A callable which takes one argument, a Change instance, and
returns <tt class="xref docutils literal"><span class="pre">True</span></tt> if the change is worth building, and <tt class="xref docutils literal"><span class="pre">False</span></tt> if
it is not.  Unimportant Changes are accumulated until the build is
triggered by an important change.  The default value of None means
that all Changes are important.</dd>
<dt><tt class="docutils literal"><span class="pre">change_filter</span></tt></dt>
<dd>The change filter that will determine which changes are recognized
by this scheduler; <a class="reference internal" href="#change-filters"><em>Change Filters</em></a>.  Note that this is
different from <tt class="docutils literal"><span class="pre">fileIsImportant</span></tt>: if the change filter filters
out a Change, then it is completely ignored by the scheduler.  If
a Change is allowed by the change filter, but is deemed
unimportant, then it will not cause builds to start, but will be
remembered and shown in status displays.</dd>
<dt><tt class="docutils literal"><span class="pre">onlyImportant</span></tt></dt>
<dd>A boolean that, when <tt class="xref docutils literal"><span class="pre">True</span></tt>, only adds important changes to the
buildset as sepcified in the <tt class="docutils literal"><span class="pre">fileIsImportant</span></tt> callable. This
means that unimportant changes are ignored the same way a
<tt class="docutils literal"><span class="pre">change_filter</span></tt> filters changes. This defaults to
<tt class="xref docutils literal"><span class="pre">False</span></tt> and only applies when <tt class="docutils literal"><span class="pre">fileIsImportant</span></tt> is
given.</dd>
</dl>
<p>The remaining subsections represent a catalog of the available Scheduler types.
All these Schedulers are defined in modules under <tt class="xref py py-mod docutils literal"><span class="pre">buildbot.schedulers</span></tt>,
and the docstrings there are the best source of documentation on the arguments
taken by each one.</p>
</div>
<div class="section" id="change-filters">
<span id="id3"></span><h2>Change Filters<a class="headerlink" href="#change-filters" title="Permalink to this headline">¶</a></h2>
<dl class="class">
<dt id="buidbot.changes.filter.ChangeFilter">
<em class="property">class </em><tt class="descclassname">buidbot.changes.filter.</tt><tt class="descname">ChangeFilter</tt><a class="headerlink" href="#buidbot.changes.filter.ChangeFilter" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<p>Several schedulers perform filtering on an incoming set of changes.  The filter
can most generically be specified as a <tt class="xref py py-class docutils literal"><span class="pre">ChangeFilter</span></tt>.  Set up a
<tt class="xref py py-class docutils literal"><span class="pre">ChangeFilter</span></tt> like this:</p>
<div class="highlight-python"><div class="highlight"><pre><span class="kn">from</span> <span class="nn">buildbot.changes.filter</span> <span class="kn">import</span> <span class="n">ChangeFilter</span>
<span class="n">my_filter</span> <span class="o">=</span> <span class="n">ChangeFilter</span><span class="p">(</span>
    <span class="n">project_re</span><span class="o">=</span><span class="s">&quot;^baseproduct/.*&quot;</span><span class="p">,</span>
    <span class="n">branch</span><span class="o">=</span><span class="s">&quot;devel&quot;</span><span class="p">)</span>
</pre></div>
</div>
<p>and then add it to a scheduler with the <tt class="docutils literal"><span class="pre">change_filter</span></tt> parameter:</p>
<div class="highlight-python"><div class="highlight"><pre><span class="n">sch</span> <span class="o">=</span> <span class="n">SomeSchedulerClass</span><span class="p">(</span><span class="o">...</span><span class="p">,</span>
    <span class="n">change_filter</span><span class="o">=</span><span class="n">my_filter</span><span class="p">)</span>
</pre></div>
</div>
<p>There are four attributes of changes on which you can filter:</p>
<dl class="docutils">
<dt><tt class="docutils literal"><span class="pre">project</span></tt></dt>
<dd>the project string, as defined by the ChangeSource.</dd>
<dt><tt class="docutils literal"><span class="pre">repository</span></tt></dt>
<dd>the repository in which this change occurred.</dd>
<dt><tt class="docutils literal"><span class="pre">branch</span></tt></dt>
<dd>the branch on which this change occurred.  Note that 'trunk' or 'master' is often
denoted by <tt class="xref docutils literal"><span class="pre">None</span></tt>.</dd>
<dt><tt class="docutils literal"><span class="pre">category</span></tt></dt>
<dd>the category, again as defined by the ChangeSource.</dd>
</dl>
<p>For each attribute, the filter can look for a single, specific value:</p>
<div class="highlight-python"><div class="highlight"><pre><span class="n">my_filter</span> <span class="o">=</span> <span class="n">ChangeFilter</span><span class="p">(</span><span class="n">project</span> <span class="o">=</span> <span class="s">&#39;myproject&#39;</span><span class="p">)</span>
</pre></div>
</div>
<p>or accept any of a set of values:</p>
<div class="highlight-python"><div class="highlight"><pre><span class="n">my_filter</span> <span class="o">=</span> <span class="n">ChangeFilter</span><span class="p">(</span><span class="n">project</span> <span class="o">=</span> <span class="p">[</span><span class="s">&#39;myproject&#39;</span><span class="p">,</span> <span class="s">&#39;jimsproject&#39;</span><span class="p">])</span>
</pre></div>
</div>
<p>or apply a regular expression, using the attribute name with a &quot;<tt class="docutils literal"><span class="pre">_re</span></tt>&quot;
suffix:</p>
<div class="highlight-python"><div class="highlight"><pre><span class="n">my_filter</span> <span class="o">=</span> <span class="n">ChangeFilter</span><span class="p">(</span><span class="n">category_re</span> <span class="o">=</span> <span class="s">&#39;.*deve.*&#39;</span><span class="p">)</span>
<span class="c"># or, to use regular expression flags:</span>
<span class="kn">import</span> <span class="nn">re</span>
<span class="n">my_filter</span> <span class="o">=</span> <span class="n">ChangeFilter</span><span class="p">(</span><span class="n">category_re</span> <span class="o">=</span> <span class="n">re</span><span class="o">.</span><span class="n">compile</span><span class="p">(</span><span class="s">&#39;.*deve.*&#39;</span><span class="p">,</span> <span class="n">re</span><span class="o">.</span><span class="n">I</span><span class="p">))</span>
</pre></div>
</div>
<p>For anything more complicated, define a Python function to recognize the strings
you want:</p>
<div class="highlight-python"><div class="highlight"><pre><span class="k">def</span> <span class="nf">my_branch_fn</span><span class="p">(</span><span class="n">branch</span><span class="p">):</span>
    <span class="k">return</span> <span class="n">branch</span> <span class="ow">in</span> <span class="n">branches_to_build</span> <span class="ow">and</span> <span class="n">branch</span> <span class="ow">not</span> <span class="ow">in</span> <span class="n">branches_to_ignore</span>
<span class="n">my_filter</span> <span class="o">=</span> <span class="n">ChangeFilter</span><span class="p">(</span><span class="n">branch_fn</span> <span class="o">=</span> <span class="n">my_branch_fn</span><span class="p">)</span>
</pre></div>
</div>
<p>The special argument <tt class="docutils literal"><span class="pre">filter_fn</span></tt> can be used to specify a function that is
given the entire Change object, and returns a boolean.</p>
<p>The entire set of allowed arguments, then, is</p>
<table border="1" class="docutils">
<colgroup>
<col width="29%" />
<col width="36%" />
<col width="36%" />
</colgroup>
<tbody valign="top">
<tr><td>project</td>
<td>project_re</td>
<td>project_fn</td>
</tr>
<tr><td>repository</td>
<td>repository_re</td>
<td>repository_fn</td>
</tr>
<tr><td>branch</td>
<td>branch_re</td>
<td>branch_fn</td>
</tr>
<tr><td>category</td>
<td>category_re</td>
<td>category_fn</td>
</tr>
<tr><td colspan="3">filter_fn</td>
</tr>
</tbody>
</table>
<p>A Change passes the filter only if <em>all</em> arguments are satisfied.  If no
filter object is given to a scheduler, then all changes will be built (subject
to any other restrictions the scheduler enforces).</p>
<span class="target" id="sched-SingleBranchScheduler"></span></div>
<div class="section" id="singlebranchscheduler">
<span id="scheduler-singlebranchscheduler"></span><span id="sched-Scheduler"></span><h2>SingleBranchScheduler<a class="headerlink" href="#singlebranchscheduler" title="Permalink to this headline">¶</a></h2>
<dl class="class">
<dt id="buildbot.schedulers.basic.SingleBranchScheduler">
<em class="property">class </em><tt class="descclassname">buildbot.schedulers.basic.</tt><tt class="descname">SingleBranchScheduler</tt><a class="headerlink" href="#buildbot.schedulers.basic.SingleBranchScheduler" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<p>This is the original and still most popular scheduler class. It follows
exactly one branch, and starts a configurable tree-stable-timer after
each change on that branch. When the timer expires, it starts a build
on some set of Builders. The Scheduler accepts a <tt class="xref py py-meth docutils literal"><span class="pre">fileIsImportant</span></tt>
function which can be used to ignore some Changes if they do not
affect any <em>important</em> files.</p>
<p>The arguments to this scheduler are:</p>
<p><tt class="docutils literal"><span class="pre">name</span></tt></p>
<p><tt class="docutils literal"><span class="pre">builderNames</span></tt></p>
<p><tt class="docutils literal"><span class="pre">properties</span></tt></p>
<p><tt class="docutils literal"><span class="pre">fileIsImportant</span></tt></p>
<p><tt class="docutils literal"><span class="pre">change_filter</span></tt></p>
<dl class="docutils">
<dt><tt class="docutils literal"><span class="pre">onlyImportant</span></tt></dt>
<dd>See <a class="reference internal" href="#configuring-schedulers"><em>Configuring Schedulers</em></a>.</dd>
<dt><tt class="docutils literal"><span class="pre">treeStableTimer</span></tt></dt>
<dd><p class="first">The scheduler will wait for this many seconds before starting the
build. If new changes are made during this interval, the timer will be
restarted, so really the build will be started after a change and then
after this many seconds of inactivity.</p>
<p class="last">If <tt class="docutils literal"><span class="pre">treeStableTimer</span></tt> is <tt class="xref docutils literal"><span class="pre">None</span></tt>, then a separate build is started
immediately for each Change.</p>
</dd>
<dt><tt class="docutils literal"><span class="pre">fileIsImportant</span></tt></dt>
<dd>A callable which takes one argument, a Change instance, and returns
<tt class="xref docutils literal"><span class="pre">True</span></tt> if the change is worth building, and <tt class="xref docutils literal"><span class="pre">False</span></tt> if
it is not.  Unimportant Changes are accumulated until the build is
triggered by an important change.  The default value of None means
that all Changes are important.</dd>
<dt><tt class="docutils literal"><span class="pre">categories</span></tt> (deprecated; use change_filter)</dt>
<dd>A list of categories of changes that this scheduler will respond to.  If this
is specified, then any non-matching changes are ignored.</dd>
<dt><tt class="docutils literal"><span class="pre">branch</span></tt> (deprecated; use change_filter)</dt>
<dd><p class="first">The scheduler will pay attention to this branch, ignoring Changes
that occur on other branches. Setting <tt class="docutils literal"><span class="pre">branch</span></tt> equal to the
special value of <tt class="xref docutils literal"><span class="pre">None</span></tt> means it should only pay attention to
the default branch.</p>
<div class="last admonition note">
<p class="first admonition-title">Note</p>
<p class="last"><tt class="xref docutils literal"><span class="pre">None</span></tt> is a keyword, not a string, so write <tt class="xref docutils literal"><span class="pre">None</span></tt>
and not <tt class="docutils literal"><span class="pre">&quot;None&quot;</span></tt>.</p>
</div>
</dd>
</dl>
<p>Example:</p>
<div class="highlight-python"><div class="highlight"><pre><span class="kn">from</span> <span class="nn">buildbot.schedulers.basic</span>  <span class="kn">import</span> <span class="n">SingleBranchScheduler</span>
<span class="kn">from</span> <span class="nn">buildbot.changes</span> <span class="kn">import</span> <span class="nb">filter</span>
<span class="n">quick</span> <span class="o">=</span> <span class="n">SingleBranchScheduler</span><span class="p">(</span><span class="n">name</span><span class="o">=</span><span class="s">&quot;quick&quot;</span><span class="p">,</span>
                    <span class="n">change_filter</span><span class="o">=</span><span class="nb">filter</span><span class="o">.</span><span class="n">ChangeFilter</span><span class="p">(</span><span class="n">branch</span><span class="o">=</span><span class="s">&#39;master&#39;</span><span class="p">),</span>
                    <span class="n">treeStableTimer</span><span class="o">=</span><span class="mi">60</span><span class="p">,</span>
                    <span class="n">builderNames</span><span class="o">=</span><span class="p">[</span><span class="s">&quot;quick-linux&quot;</span><span class="p">,</span> <span class="s">&quot;quick-netbsd&quot;</span><span class="p">])</span>
<span class="n">full</span> <span class="o">=</span> <span class="n">SingleBranchScheduler</span><span class="p">(</span><span class="n">name</span><span class="o">=</span><span class="s">&quot;full&quot;</span><span class="p">,</span>
                    <span class="n">change_filter</span><span class="o">=</span><span class="nb">filter</span><span class="o">.</span><span class="n">ChangeFilter</span><span class="p">(</span><span class="n">branch</span><span class="o">=</span><span class="s">&#39;master&#39;</span><span class="p">),</span>
                    <span class="n">treeStableTimer</span><span class="o">=</span><span class="mi">5</span><span class="o">*</span><span class="mi">60</span><span class="p">,</span>
                    <span class="n">builderNames</span><span class="o">=</span><span class="p">[</span><span class="s">&quot;full-linux&quot;</span><span class="p">,</span> <span class="s">&quot;full-netbsd&quot;</span><span class="p">,</span> <span class="s">&quot;full-OSX&quot;</span><span class="p">])</span>
<span class="n">c</span><span class="p">[</span><span class="s">&#39;schedulers&#39;</span><span class="p">]</span> <span class="o">=</span> <span class="p">[</span><span class="n">quick</span><span class="p">,</span> <span class="n">full</span><span class="p">]</span>
</pre></div>
</div>
<p>In this example, the two <em>quick</em> builders are triggered 60 seconds
after the tree has been changed. The <em>full</em> builds do not run quite
so quickly (they wait 5 minutes), so hopefully if the quick builds
fail due to a missing file or really simple typo, the developer can
discover and fix the problem before the full builds are started. Both
Schedulers only pay attention to the default branch: any changes
on other branches are ignored by these schedulers. Each scheduler
triggers a different set of Builders, referenced by name.</p>
<dl class="class">
<dt id="buildbot.schedulers.basic.Scheduler">
<em class="property">class </em><tt class="descclassname">buildbot.schedulers.basic.</tt><tt class="descname">Scheduler</tt><a class="headerlink" href="#buildbot.schedulers.basic.Scheduler" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="class">
<dt id="buildbot.scheduler.Scheduler">
<em class="property">class </em><tt class="descclassname">buildbot.scheduler.</tt><tt class="descname">Scheduler</tt><a class="headerlink" href="#buildbot.scheduler.Scheduler" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<p>The old names for this scheduler, <tt class="docutils literal"><span class="pre">buildbot.scheduler.Scheduler</span></tt> and
<tt class="docutils literal"><span class="pre">buildbot.schedulers.basic.Scheduler</span></tt>, are deprecated in favor of the more
accurate name <tt class="docutils literal"><span class="pre">buildbot.schedulers.basic.SingleBranchScheduler</span></tt>.</p>
</div>
<div class="section" id="anybranchscheduler">
<span id="sched-AnyBranchScheduler"></span><span id="id4"></span><h2>AnyBranchScheduler<a class="headerlink" href="#anybranchscheduler" title="Permalink to this headline">¶</a></h2>
<p>This scheduler uses a tree-stable-timer like the default one, but
uses a separate timer for each branch.</p>
<p>The arguments to this scheduler are:</p>
<p><tt class="docutils literal"><span class="pre">name</span></tt></p>
<p><tt class="docutils literal"><span class="pre">builderNames</span></tt></p>
<p><tt class="docutils literal"><span class="pre">properties</span></tt></p>
<p><tt class="docutils literal"><span class="pre">fileIsImportant</span></tt></p>
<p><tt class="docutils literal"><span class="pre">change_filter</span></tt></p>
<dl class="docutils">
<dt><tt class="docutils literal"><span class="pre">onlyImportant</span></tt></dt>
<dd>See <a class="reference internal" href="#configuring-schedulers"><em>Configuring Schedulers</em></a>.</dd>
<dt><tt class="docutils literal"><span class="pre">treeStableTimer</span></tt></dt>
<dd>The scheduler will wait for this many seconds before starting the build. If
new changes are made <em>on the same branch</em> during this interval, the timer
will be restarted.</dd>
<dt><tt class="docutils literal"><span class="pre">branches</span></tt> (deprecated; use change_filter)</dt>
<dd>Changes on branches not specified on this list will be ignored.</dd>
<dt><tt class="docutils literal"><span class="pre">categories</span></tt> (deprecated; use change_filter)</dt>
<dd>A list of categories of changes that this scheduler will respond to.  If this
is specified, then any non-matching changes are ignored.</dd>
</dl>
</div>
<div class="section" id="dependent-scheduler">
<span id="sched-Dependent"></span><span id="id5"></span><h2>Dependent Scheduler<a class="headerlink" href="#dependent-scheduler" title="Permalink to this headline">¶</a></h2>
<p>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
<em>full</em> builds after a failing <em>quick</em> 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 <em>after</em> the producing one.</p>
<p>You can use <em>Dependencies</em> to express this relationship
to the Buildbot. There is a special kind of scheduler named
<tt class="xref py py-class docutils literal"><span class="pre">scheduler.Dependent</span></tt> that will watch an <em>upstream</em> scheduler
for builds to complete successfully (on all of its Builders). Each time
that happens, the same source code (i.e. the same <tt class="docutils literal"><span class="pre">SourceStamp</span></tt>)
will be used to start a new set of builds, on a different set of
Builders. This <em>downstream</em> scheduler doesn't pay attention to
Changes at all. It only pays attention to the upstream scheduler.</p>
<p>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 <tt class="docutils literal"><span class="pre">revision</span></tt> is <tt class="xref docutils literal"><span class="pre">None</span></tt>, 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 <a class="reference internal" href="#triggerable-scheduler"><em>Triggerable Scheduler</em></a> for a more flexible dependency
mechanism that can avoid this problem.</p>
<p>The keyword arguments to this scheduler are:</p>
<p><tt class="docutils literal"><span class="pre">name</span></tt></p>
<p><tt class="docutils literal"><span class="pre">builderNames</span></tt></p>
<dl class="docutils">
<dt><tt class="docutils literal"><span class="pre">properties</span></tt></dt>
<dd>See <a class="reference internal" href="#configuring-schedulers"><em>Configuring Schedulers</em></a>.</dd>
<dt><tt class="docutils literal"><span class="pre">upstream</span></tt></dt>
<dd>The upstream scheduler to watch.  Note that this is an <em>instance</em>,
not the name of the scheduler.</dd>
</dl>
<p>Example:</p>
<div class="highlight-python"><div class="highlight"><pre><span class="kn">from</span> <span class="nn">buildbot.schedulers</span> <span class="kn">import</span> <span class="n">basic</span>
<span class="n">tests</span> <span class="o">=</span> <span class="n">basic</span><span class="o">.</span><span class="n">SingleBranchScheduler</span><span class="p">(</span><span class="s">&quot;just-tests&quot;</span><span class="p">,</span> <span class="bp">None</span><span class="p">,</span> <span class="mi">5</span><span class="o">*</span><span class="mi">60</span><span class="p">,</span>
                                    <span class="p">[</span><span class="s">&quot;full-linux&quot;</span><span class="p">,</span> <span class="s">&quot;full-netbsd&quot;</span><span class="p">,</span> <span class="s">&quot;full-OSX&quot;</span><span class="p">])</span>
<span class="n">package</span> <span class="o">=</span> <span class="n">basic</span><span class="o">.</span><span class="n">Dependent</span><span class="p">(</span><span class="n">name</span><span class="o">=</span><span class="s">&quot;build-package&quot;</span><span class="p">,</span>
                          <span class="n">upstream</span><span class="o">=</span><span class="n">tests</span><span class="p">,</span> <span class="c"># &lt;- no quotes!</span>
                          <span class="n">builderNames</span><span class="o">=</span><span class="p">[</span><span class="s">&quot;make-tarball&quot;</span><span class="p">,</span> <span class="s">&quot;make-deb&quot;</span><span class="p">,</span> <span class="s">&quot;make-rpm&quot;</span><span class="p">])</span>
<span class="n">c</span><span class="p">[</span><span class="s">&#39;schedulers&#39;</span><span class="p">]</span> <span class="o">=</span> <span class="p">[</span><span class="n">tests</span><span class="p">,</span> <span class="n">package</span><span class="p">]</span>
</pre></div>
</div>
</div>
<div class="section" id="periodic-scheduler">
<span id="sched-Periodic"></span><span id="id6"></span><h2>Periodic Scheduler<a class="headerlink" href="#periodic-scheduler" title="Permalink to this headline">¶</a></h2>
<dl class="class">
<dt id="buildbot.schedulers.timed.Periodic">
<em class="property">class </em><tt class="descclassname">buildbot.schedulers.timed.</tt><tt class="descname">Periodic</tt><a class="headerlink" href="#buildbot.schedulers.timed.Periodic" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<p>This simple scheduler just triggers a build every <em>N</em> seconds.</p>
<p>The arguments to this scheduler are:</p>
<p><tt class="docutils literal"><span class="pre">name</span></tt></p>
<p><tt class="docutils literal"><span class="pre">builderNames</span></tt></p>
<p><tt class="docutils literal"><span class="pre">properties</span></tt></p>
<p><tt class="docutils literal"><span class="pre">onlyImportant</span></tt></p>
<dl class="docutils">
<dt><tt class="docutils literal"><span class="pre">periodicBuildTimer</span></tt></dt>
<dd>The time, in seconds, after which to start a build.</dd>
</dl>
<p>Example:</p>
<div class="highlight-python"><div class="highlight"><pre><span class="kn">from</span> <span class="nn">buildbot.schedulers</span> <span class="kn">import</span> <span class="n">timed</span>
<span class="n">nightly</span> <span class="o">=</span> <span class="n">timed</span><span class="o">.</span><span class="n">Periodic</span><span class="p">(</span><span class="n">name</span><span class="o">=</span><span class="s">&quot;daily&quot;</span><span class="p">,</span>
                <span class="n">builderNames</span><span class="o">=</span><span class="p">[</span><span class="s">&quot;full-solaris&quot;</span><span class="p">],</span>
                <span class="n">periodicBuildTimer</span><span class="o">=</span><span class="mi">24</span><span class="o">*</span><span class="mi">60</span><span class="o">*</span><span class="mi">60</span><span class="p">)</span>
<span class="n">c</span><span class="p">[</span><span class="s">&#39;schedulers&#39;</span><span class="p">]</span> <span class="o">=</span> <span class="p">[</span><span class="n">nightly</span><span class="p">]</span>
</pre></div>
</div>
<p>The scheduler in this example just runs the full solaris build once
per day. Note that this scheduler only lets you control the time
between builds, not the absolute time-of-day of each Build, so this
could easily wind up an <em>evening</em> or <em>every afternoon</em> scheduler
depending upon when it was first activated.</p>
<span class="target" id="nightly-scheduler"></span></div>
<div class="section" id="sched-Nightly">
<span id="id7"></span><h2>Nightly Scheduler<a class="headerlink" href="#sched-Nightly" title="Permalink to this headline">¶</a></h2>
<p>This is highly configurable periodic build scheduler, which triggers
a build at particular times of day, week, month, or year. The
configuration syntax is very similar to the well-known <tt class="docutils literal"><span class="pre">crontab</span></tt>
format, in which you provide values for minute, hour, day, and month
(some of which can be wildcards), and a build is triggered whenever
the current time matches the given constraints. This can run a build
every night, every morning, every weekend, alternate Thursdays,
on your boss's birthday, etc.</p>
<p>Pass some subset of <tt class="docutils literal"><span class="pre">minute</span></tt>, <tt class="docutils literal"><span class="pre">hour</span></tt>, <tt class="docutils literal"><span class="pre">dayOfMonth</span></tt>,
<tt class="docutils literal"><span class="pre">month</span></tt>, and <tt class="docutils literal"><span class="pre">dayOfWeek</span></tt>; each may be a single number or
a list of valid values. The builds will be triggered whenever the
current time matches these values. Wildcards are represented by a
'*' string. All fields default to a wildcard except 'minute', so
with no fields this defaults to a build every hour, on the hour.
The full list of parameters is:</p>
<p><tt class="docutils literal"><span class="pre">name</span></tt></p>
<p><tt class="docutils literal"><span class="pre">builderNames</span></tt></p>
<p><tt class="docutils literal"><span class="pre">properties</span></tt></p>
<p><tt class="docutils literal"><span class="pre">fileIsImportant</span></tt></p>
<p><tt class="docutils literal"><span class="pre">change_filter</span></tt></p>
<dl class="docutils">
<dt><tt class="docutils literal"><span class="pre">onlyImportant</span></tt></dt>
<dd>See <a class="reference internal" href="#configuring-schedulers"><em>Configuring Schedulers</em></a>.  Note that <tt class="docutils literal"><span class="pre">fileIsImportant</span></tt> and
<tt class="docutils literal"><span class="pre">change_filter</span></tt> are only relevant if <tt class="docutils literal"><span class="pre">onlyIfChanged</span></tt> is
<tt class="xref docutils literal"><span class="pre">True</span></tt>.</dd>
<dt><tt class="docutils literal"><span class="pre">onlyIfChanged</span></tt></dt>
<dd>If this is true, then builds will not be scheduled at the designated time
<em>unless</em> the specified branch has seen an important change since
the previous build.</dd>
<dt><tt class="docutils literal"><span class="pre">branch</span></tt></dt>
<dd>(required) The branch to build when the time comes.  Remember that
a value of <tt class="xref docutils literal"><span class="pre">None</span></tt> here means the default branch, and will not
match other branches!</dd>
<dt><tt class="docutils literal"><span class="pre">minute</span></tt></dt>
<dd>The minute of the hour on which to start the build.  This defaults
to 0, meaning an hourly build.</dd>
<dt><tt class="docutils literal"><span class="pre">hour</span></tt></dt>
<dd>The hour of the day on which to start the build, in 24-hour notation.
This defaults to *, meaning every hour.</dd>
<dt><tt class="docutils literal"><span class="pre">dayOfMonth</span></tt></dt>
<dd>The day of the month to start a build.  This defauls to <tt class="docutils literal"><span class="pre">*</span></tt>, meaning
every day.</dd>
<dt><tt class="docutils literal"><span class="pre">month</span></tt></dt>
<dd>The month in which to start the build, with January = 1.  This defaults
to *, meaning every month.</dd>
<dt><tt class="docutils literal"><span class="pre">dayOfWeek</span></tt></dt>
<dd>The day of the week to start a build, with Monday = 0.  This defauls
to *, meaning every day of the week.</dd>
</dl>
<p>For example, the following master.cfg clause will cause a build to be
started every night at 3:00am:</p>
<div class="highlight-python"><div class="highlight"><pre><span class="kn">from</span> <span class="nn">buildbot.schedulers</span> <span class="kn">import</span> <span class="n">timed</span>
<span class="n">c</span><span class="p">[</span><span class="s">&#39;schedulers&#39;</span><span class="p">]</span><span class="o">.</span><span class="n">append</span><span class="p">(</span>
    <span class="n">timed</span><span class="o">.</span><span class="n">Nightly</span><span class="p">(</span><span class="n">name</span><span class="o">=</span><span class="s">&#39;nightly&#39;</span><span class="p">,</span>
        <span class="n">branch</span><span class="o">=</span><span class="s">&#39;master&#39;</span><span class="p">,</span>
        <span class="n">builderNames</span><span class="o">=</span><span class="p">[</span><span class="s">&#39;builder1&#39;</span><span class="p">,</span> <span class="s">&#39;builder2&#39;</span><span class="p">],</span>
        <span class="n">hour</span><span class="o">=</span><span class="mi">3</span><span class="p">,</span>
        <span class="n">minute</span><span class="o">=</span><span class="mi">0</span><span class="p">))</span>
</pre></div>
</div>
<p>This scheduler will perform a build each monday morning at 6:23am and
again at 8:23am, but only if someone has committed code in the interim:</p>
<div class="highlight-python"><div class="highlight"><pre><span class="n">c</span><span class="p">[</span><span class="s">&#39;schedulers&#39;</span><span class="p">]</span><span class="o">.</span><span class="n">append</span><span class="p">(</span>
    <span class="n">timed</span><span class="o">.</span><span class="n">Nightly</span><span class="p">(</span><span class="n">name</span><span class="o">=</span><span class="s">&#39;BeforeWork&#39;</span><span class="p">,</span>
         <span class="n">branch</span><span class="o">=</span><span class="sb">`default`</span><span class="p">,</span>
         <span class="n">builderNames</span><span class="o">=</span><span class="p">[</span><span class="s">&#39;builder1&#39;</span><span class="p">],</span>
         <span class="n">dayOfWeek</span><span class="o">=</span><span class="mi">0</span><span class="p">,</span>
         <span class="n">hour</span><span class="o">=</span><span class="p">[</span><span class="mi">6</span><span class="p">,</span><span class="mi">8</span><span class="p">],</span>
         <span class="n">minute</span><span class="o">=</span><span class="mi">23</span><span class="p">,</span>
         <span class="n">onlyIfChanged</span><span class="o">=</span><span class="bp">True</span><span class="p">))</span>
</pre></div>
</div>
<p>The following runs a build every two hours, using Python's <tt class="xref py py-func docutils literal"><span class="pre">range</span></tt>
function:</p>
<div class="highlight-python"><div class="highlight"><pre><span class="n">c</span><span class="o">.</span><span class="n">schedulers</span><span class="o">.</span><span class="n">append</span><span class="p">(</span>
    <span class="n">timed</span><span class="o">.</span><span class="n">Nightly</span><span class="p">(</span><span class="n">name</span><span class="o">=</span><span class="s">&#39;every2hours&#39;</span><span class="p">,</span>
        <span class="n">branch</span><span class="o">=</span><span class="bp">None</span><span class="p">,</span> <span class="c"># default branch</span>
        <span class="n">builderNames</span><span class="o">=</span><span class="p">[</span><span class="s">&#39;builder1&#39;</span><span class="p">],</span>
        <span class="n">hour</span><span class="o">=</span><span class="nb">range</span><span class="p">(</span><span class="mi">0</span><span class="p">,</span> <span class="mi">24</span><span class="p">,</span> <span class="mi">2</span><span class="p">)))</span>
</pre></div>
</div>
<p>Finally, this example will run only on December 24th:</p>
<div class="highlight-python"><div class="highlight"><pre><span class="n">c</span><span class="p">[</span><span class="s">&#39;schedulers&#39;</span><span class="p">]</span><span class="o">.</span><span class="n">append</span><span class="p">(</span>
    <span class="n">timed</span><span class="o">.</span><span class="n">Nightly</span><span class="p">(</span><span class="n">name</span><span class="o">=</span><span class="s">&#39;SleighPreflightCheck&#39;</span><span class="p">,</span>
        <span class="n">branch</span><span class="o">=</span><span class="bp">None</span><span class="p">,</span> <span class="c"># default branch</span>
        <span class="n">builderNames</span><span class="o">=</span><span class="p">[</span><span class="s">&#39;flying_circuits&#39;</span><span class="p">,</span> <span class="s">&#39;radar&#39;</span><span class="p">],</span>
        <span class="n">month</span><span class="o">=</span><span class="mi">12</span><span class="p">,</span>
        <span class="n">dayOfMonth</span><span class="o">=</span><span class="mi">24</span><span class="p">,</span>
        <span class="n">hour</span><span class="o">=</span><span class="mi">12</span><span class="p">,</span>
        <span class="n">minute</span><span class="o">=</span><span class="mi">0</span><span class="p">))</span>
</pre></div>
</div>
<span class="target" id="sched-Try_Jobdir"></span></div>
<div class="section" id="try-schedulers">
<span id="sched-Try_Userpass"></span><span id="id8"></span><h2>Try Schedulers<a class="headerlink" href="#try-schedulers" title="Permalink to this headline">¶</a></h2>
<dl class="class">
<dt id="buildbot.schedulers.trysched.Try_Jobdir">
<em class="property">class </em><tt class="descclassname">buildbot.schedulers.trysched.</tt><tt class="descname">Try_Jobdir</tt><a class="headerlink" href="#buildbot.schedulers.trysched.Try_Jobdir" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="class">
<dt id="buildbot.schedulers.trysched.Try_Userpass">
<em class="property">class </em><tt class="descclassname">buildbot.schedulers.trysched.</tt><tt class="descname">Try_Userpass</tt><a class="headerlink" href="#buildbot.schedulers.trysched.Try_Userpass" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<p>This scheduler allows developers to use the <strong class="command">buildbot try</strong>
command to trigger builds of code they have not yet committed. See
<a class="reference internal" href="cmdline.html#cmdline-try" title="try"><tt class="xref bb bb-cmdline docutils literal"><span class="pre">try</span></tt></a> for complete details.</p>
<p>Two implementations are available: <a class="reference internal" href="#sched-Try_Jobdir" title="Try_Jobdir"><tt class="xref bb bb-sched docutils literal"><span class="pre">Try_Jobdir</span></tt></a> and
<a class="reference internal" href="#sched-Try_Userpass" title="Try_Userpass"><tt class="xref bb bb-sched docutils literal"><span class="pre">Try_Userpass</span></tt></a>.  The former monitors a job directory, specified
by the <tt class="docutils literal"><span class="pre">jobdir</span></tt> parameter, while the latter listens for PB
connections on a specific <tt class="docutils literal"><span class="pre">port</span></tt>, and authenticates against
<tt class="docutils literal"><span class="pre">userport</span></tt>.</p>
<p>The buildmaster must have a scheduler instance in the config file's
<a class="reference internal" href="#cfg-schedulers" title="schedulers"><tt class="xref bb bb-cfg docutils literal"><span class="pre">schedulers</span></tt></a> list to receive try requests. This lets the
administrator control who may initiate these <cite>trial</cite> builds, which branches
are eligible for trial builds, and which Builders should be used for them.</p>
<p>The scheduler has various means to accept build requests.
All of them enforce more security than the usual buildmaster ports do.
Any source code being built can be used to compromise the buildslave
accounts, but in general that code must be checked out from the VC
repository first, so only people with commit privileges can get
control of the buildslaves. The usual force-build control channels can
waste buildslave time but do not allow arbitrary commands to be
executed by people who don't have those commit privileges. However,
the source code patch that is provided with the trial build does not
have to go through the VC system first, so it is important to make
sure these builds cannot be abused by a non-committer to acquire as
much control over the buildslaves as a committer has. Ideally, only
developers who have commit access to the VC repository would be able
to start trial builds, but unfortunately the buildmaster does not, in
general, have access to VC system's user list.</p>
<p>As a result, the try scheduler requires a bit more configuration. There are
currently two ways to set this up:</p>
<dl class="docutils">
<dt><tt class="docutils literal"><span class="pre">jobdir</span></tt> (ssh)</dt>
<dd><p class="first">This approach creates a command queue directory, called the
<tt class="file docutils literal"><span class="pre">jobdir</span></tt>, in the buildmaster's working directory. The buildmaster
admin sets the ownership and permissions of this directory to only
grant write access to the desired set of developers, all of whom must
have accounts on the machine. The <strong class="command">buildbot try</strong> command creates
a special file containing the source stamp information and drops it in
the jobdir, just like a standard maildir. When the buildmaster notices
the new file, it unpacks the information inside and starts the builds.</p>
<p>The config file entries used by 'buildbot try' either specify a local
queuedir (for which write and mv are used) or a remote one (using scp
and ssh).</p>
<p>The advantage of this scheme is that it is quite secure, the
disadvantage is that it requires fiddling outside the buildmaster
config (to set the permissions on the jobdir correctly). If the
buildmaster machine happens to also house the VC repository, then it
can be fairly easy to keep the VC userlist in sync with the
trial-build userlist. If they are on different machines, this will be
much more of a hassle. It may also involve granting developer accounts
on a machine that would not otherwise require them.</p>
<p class="last">To implement this, the buildslave invokes <tt class="samp docutils literal"><span class="pre">ssh</span> <span class="pre">-l</span> <em><span class="pre">username</span></em> <em><span class="pre">host</span></em>
<span class="pre">buildbot</span> <span class="pre">tryserver</span> <em><span class="pre">ARGS</span></em></tt>, passing the patch contents over stdin. The
arguments must include the inlet directory and the revision
information.</p>
</dd>
<dt><tt class="docutils literal"><span class="pre">user+password</span></tt> (PB)</dt>
<dd><p class="first">In this approach, each developer gets a username/password pair, which
are all listed in the buildmaster's configuration file. When the
developer runs <strong class="command">buildbot try</strong>, their machine connects to the
buildmaster via PB and authenticates themselves using that username
and password, then sends a PB command to start the trial build.</p>
<p class="last">The advantage of this scheme is that the entire configuration is
performed inside the buildmaster's config file. The disadvantages are
that it is less secure (while the <cite>cred</cite> authentication system does
not expose the password in plaintext over the wire, it does not offer
most of the other security properties that SSH does). In addition, the
buildmaster admin is responsible for maintaining the username/password
list, adding and deleting entries as developers come and go.</p>
</dd>
</dl>
<p>For example, to set up the <cite>jobdir</cite> style of trial build, using a
command queue directory of <tt class="file docutils literal"><em><span class="pre">MASTERDIR</span></em><span class="pre">/jobdir</span></tt> (and assuming that
all your project developers were members of the <tt class="docutils literal"><span class="pre">developers</span></tt> unix
group), you would first set up that directory:</p>
<div class="highlight-bash"><div class="highlight"><pre>mkdir -p MASTERDIR/jobdir MASTERDIR/jobdir/new MASTERDIR/jobdir/cur MASTERDIR/jobdir/tmp
chgrp developers MASTERDIR/jobdir MASTERDIR/jobdir/*
chmod g+rwx,o-rwx MASTERDIR/jobdir MASTERDIR/jobdir/*
</pre></div>
</div>
<p>and then use the following scheduler in the buildmaster's config file:</p>
<div class="highlight-python"><div class="highlight"><pre><span class="kn">from</span> <span class="nn">buildbot.schedulers.trysched</span> <span class="kn">import</span> <span class="n">Try_Jobdir</span>
<span class="n">s</span> <span class="o">=</span> <span class="n">Try_Jobdir</span><span class="p">(</span><span class="n">name</span><span class="o">=</span><span class="s">&quot;try1&quot;</span><span class="p">,</span>
               <span class="n">builderNames</span><span class="o">=</span><span class="p">[</span><span class="s">&quot;full-linux&quot;</span><span class="p">,</span> <span class="s">&quot;full-netbsd&quot;</span><span class="p">,</span> <span class="s">&quot;full-OSX&quot;</span><span class="p">],</span>
               <span class="n">jobdir</span><span class="o">=</span><span class="s">&quot;jobdir&quot;</span><span class="p">)</span>
<span class="n">c</span><span class="p">[</span><span class="s">&#39;schedulers&#39;</span><span class="p">]</span> <span class="o">=</span> <span class="p">[</span><span class="n">s</span><span class="p">]</span>
</pre></div>
</div>
<p>Note that you must create the jobdir before telling the buildmaster to
use this configuration, otherwise you will get an error. Also remember
that the buildmaster must be able to read and write to the jobdir as
well. Be sure to watch the <tt class="file docutils literal"><span class="pre">twistd.log</span></tt> file (<a class="reference internal" href="installation.html#logfiles"><em>Logfiles</em></a>)
as you start using the jobdir, to make sure the buildmaster is happy
with it.</p>
<p>To use the username/password form of authentication, create a
<tt class="xref py py-class docutils literal"><span class="pre">Try_Userpass</span></tt> instance instead. It takes the same
<tt class="docutils literal"><span class="pre">builderNames</span></tt> argument as the <tt class="xref py py-class docutils literal"><span class="pre">Try_Jobdir</span></tt> form, but
accepts an addtional <tt class="docutils literal"><span class="pre">port</span></tt> argument (to specify the TCP port to
listen on) and a <tt class="docutils literal"><span class="pre">userpass</span></tt> list of username/password pairs to
accept. Remember to use good passwords for this: the security of the
buildslave accounts depends upon it:</p>
<div class="highlight-python"><div class="highlight"><pre><span class="kn">from</span> <span class="nn">buildbot.schedulers.trysched</span> <span class="kn">import</span> <span class="n">Try_Userpass</span>
<span class="n">s</span> <span class="o">=</span> <span class="n">Try_Userpass</span><span class="p">(</span><span class="n">name</span><span class="o">=</span><span class="s">&quot;try2&quot;</span><span class="p">,</span>
                 <span class="n">builderNames</span><span class="o">=</span><span class="p">[</span><span class="s">&quot;full-linux&quot;</span><span class="p">,</span> <span class="s">&quot;full-netbsd&quot;</span><span class="p">,</span> <span class="s">&quot;full-OSX&quot;</span><span class="p">],</span>
                 <span class="n">port</span><span class="o">=</span><span class="mi">8031</span><span class="p">,</span>
                 <span class="n">userpass</span><span class="o">=</span><span class="p">[(</span><span class="s">&quot;alice&quot;</span><span class="p">,</span><span class="s">&quot;pw1&quot;</span><span class="p">),</span> <span class="p">(</span><span class="s">&quot;bob&quot;</span><span class="p">,</span> <span class="s">&quot;pw2&quot;</span><span class="p">)]</span> <span class="p">)</span>
<span class="n">c</span><span class="p">[</span><span class="s">&#39;schedulers&#39;</span><span class="p">]</span> <span class="o">=</span> <span class="p">[</span><span class="n">s</span><span class="p">]</span>
</pre></div>
</div>
<p>Like most places in the buildbot, the <tt class="docutils literal"><span class="pre">port</span></tt> argument takes a
<cite>strports</cite> specification. See <tt class="xref py py-mod docutils literal"><span class="pre">twisted.application.strports</span></tt> for
details.</p>
<span class="target" id="sched-Triggerable"></span></div>
<div class="section" id="triggerable-scheduler">
<span id="index-1"></span><span id="id9"></span><h2>Triggerable Scheduler<a class="headerlink" href="#triggerable-scheduler" title="Permalink to this headline">¶</a></h2>
<dl class="class">
<dt id="buildbot.schedulers.triggerable.Triggerable">
<em class="property">class </em><tt class="descclassname">buildbot.schedulers.triggerable.</tt><tt class="descname">Triggerable</tt><a class="headerlink" href="#buildbot.schedulers.triggerable.Triggerable" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<p>The <tt class="xref py py-class docutils literal"><span class="pre">Triggerable</span></tt> scheduler waits to be triggered by a Trigger
step (see <a class="reference internal" href="cfg-buildsteps.html#triggering-schedulers"><em>Triggering Schedulers</em></a>) in another build. That step
can optionally wait for the scheduler's builds to complete. This
provides two advantages over Dependent schedulers. First, the same
scheduler can be triggered from multiple builds. Second, the ability
to wait for a Triggerable's builds to complete provides a form of
&quot;subroutine call&quot;, where one or more builds can &quot;call&quot; a scheduler
to perform some work for them, perhaps on other buildslaves.</p>
<p>The parameters are just the basics:</p>
<p><tt class="docutils literal"><span class="pre">name</span></tt></p>
<p><tt class="docutils literal"><span class="pre">builderNames</span></tt></p>
<dl class="docutils">
<dt><tt class="docutils literal"><span class="pre">properties</span></tt></dt>
<dd>See <a class="reference internal" href="#configuring-schedulers"><em>Configuring Schedulers</em></a>.</dd>
</dl>
<p>This class is only useful in conjunction with the <tt class="xref py py-class docutils literal"><span class="pre">Trigger</span></tt> step.
Here is a fully-worked example:</p>
<div class="highlight-python"><div class="highlight"><pre><span class="kn">from</span> <span class="nn">buildbot.schedulers</span> <span class="kn">import</span> <span class="n">basic</span><span class="p">,</span> <span class="n">timed</span><span class="p">,</span> <span class="n">triggerable</span>
<span class="kn">from</span> <span class="nn">buildbot.process</span> <span class="kn">import</span> <span class="n">factory</span>
<span class="kn">from</span> <span class="nn">buildbot.steps</span> <span class="kn">import</span> <span class="n">trigger</span>

<span class="n">checkin</span> <span class="o">=</span> <span class="n">basic</span><span class="o">.</span><span class="n">SingleBranchScheduler</span><span class="p">(</span><span class="n">name</span><span class="o">=</span><span class="s">&quot;checkin&quot;</span><span class="p">,</span>
            <span class="n">branch</span><span class="o">=</span><span class="bp">None</span><span class="p">,</span>
            <span class="n">treeStableTimer</span><span class="o">=</span><span class="mi">5</span><span class="o">*</span><span class="mi">60</span><span class="p">,</span>
            <span class="n">builderNames</span><span class="o">=</span><span class="p">[</span><span class="s">&quot;checkin&quot;</span><span class="p">])</span>
<span class="n">nightly</span> <span class="o">=</span> <span class="n">timed</span><span class="o">.</span><span class="n">Nightly</span><span class="p">(</span><span class="n">name</span><span class="o">=</span><span class="s">&#39;nightly&#39;</span><span class="p">,</span>
            <span class="n">branch</span><span class="o">=</span><span class="bp">None</span><span class="p">,</span>
            <span class="n">builderNames</span><span class="o">=</span><span class="p">[</span><span class="s">&#39;nightly&#39;</span><span class="p">],</span>
            <span class="n">hour</span><span class="o">=</span><span class="mi">3</span><span class="p">,</span>
            <span class="n">minute</span><span class="o">=</span><span class="mi">0</span><span class="p">)</span>

<span class="n">mktarball</span> <span class="o">=</span> <span class="n">triggerable</span><span class="o">.</span><span class="n">Triggerable</span><span class="p">(</span><span class="n">name</span><span class="o">=</span><span class="s">&quot;mktarball&quot;</span><span class="p">,</span>
                <span class="n">builderNames</span><span class="o">=</span><span class="p">[</span><span class="s">&quot;mktarball&quot;</span><span class="p">])</span>
<span class="n">build</span> <span class="o">=</span> <span class="n">triggerable</span><span class="o">.</span><span class="n">Triggerable</span><span class="p">(</span><span class="n">name</span><span class="o">=</span><span class="s">&quot;build-all-platforms&quot;</span><span class="p">,</span>
                <span class="n">builderNames</span><span class="o">=</span><span class="p">[</span><span class="s">&quot;build-all-platforms&quot;</span><span class="p">])</span>
<span class="n">test</span> <span class="o">=</span> <span class="n">triggerable</span><span class="o">.</span><span class="n">Triggerable</span><span class="p">(</span><span class="n">name</span><span class="o">=</span><span class="s">&quot;distributed-test&quot;</span><span class="p">,</span>
                <span class="n">builderNames</span><span class="o">=</span><span class="p">[</span><span class="s">&quot;distributed-test&quot;</span><span class="p">])</span>
<span class="n">package</span> <span class="o">=</span> <span class="n">triggerable</span><span class="o">.</span><span class="n">Triggerable</span><span class="p">(</span><span class="n">name</span><span class="o">=</span><span class="s">&quot;package-all-platforms&quot;</span><span class="p">,</span>
                <span class="n">builderNames</span><span class="o">=</span><span class="p">[</span><span class="s">&quot;package-all-platforms&quot;</span><span class="p">])</span>

<span class="n">c</span><span class="p">[</span><span class="s">&#39;schedulers&#39;</span><span class="p">]</span> <span class="o">=</span> <span class="p">[</span><span class="n">mktarball</span><span class="p">,</span> <span class="n">checkin</span><span class="p">,</span> <span class="n">nightly</span><span class="p">,</span> <span class="n">build</span><span class="p">,</span> <span class="n">test</span><span class="p">,</span> <span class="n">package</span><span class="p">]</span>

<span class="c"># on checkin, make a tarball, build it, and test it</span>
<span class="n">checkin_factory</span> <span class="o">=</span> <span class="n">factory</span><span class="o">.</span><span class="n">BuildFactory</span><span class="p">()</span>
<span class="n">checkin_factory</span><span class="o">.</span><span class="n">addStep</span><span class="p">(</span><span class="n">trigger</span><span class="o">.</span><span class="n">Trigger</span><span class="p">(</span><span class="n">schedulerNames</span><span class="o">=</span><span class="p">[</span><span class="s">&#39;mktarball&#39;</span><span class="p">],</span>
                                       <span class="n">waitForFinish</span><span class="o">=</span><span class="bp">True</span><span class="p">))</span>
<span class="n">checkin_factory</span><span class="o">.</span><span class="n">addStep</span><span class="p">(</span><span class="n">trigger</span><span class="o">.</span><span class="n">Trigger</span><span class="p">(</span><span class="n">schedulerNames</span><span class="o">=</span><span class="p">[</span><span class="s">&#39;build-all-platforms&#39;</span><span class="p">],</span>
                                   <span class="n">waitForFinish</span><span class="o">=</span><span class="bp">True</span><span class="p">))</span>
<span class="n">checkin_factory</span><span class="o">.</span><span class="n">addStep</span><span class="p">(</span><span class="n">trigger</span><span class="o">.</span><span class="n">Trigger</span><span class="p">(</span><span class="n">schedulerNames</span><span class="o">=</span><span class="p">[</span><span class="s">&#39;distributed-test&#39;</span><span class="p">],</span>
                                  <span class="n">waitForFinish</span><span class="o">=</span><span class="bp">True</span><span class="p">))</span>

<span class="c"># and every night, make a tarball, build it, and package it</span>
<span class="n">nightly_factory</span> <span class="o">=</span> <span class="n">factory</span><span class="o">.</span><span class="n">BuildFactory</span><span class="p">()</span>
<span class="n">nightly_factory</span><span class="o">.</span><span class="n">addStep</span><span class="p">(</span><span class="n">trigger</span><span class="o">.</span><span class="n">Trigger</span><span class="p">(</span><span class="n">schedulerNames</span><span class="o">=</span><span class="p">[</span><span class="s">&#39;mktarball&#39;</span><span class="p">],</span>
                                       <span class="n">waitForFinish</span><span class="o">=</span><span class="bp">True</span><span class="p">))</span>
<span class="n">nightly_factory</span><span class="o">.</span><span class="n">addStep</span><span class="p">(</span><span class="n">trigger</span><span class="o">.</span><span class="n">Trigger</span><span class="p">(</span><span class="n">schedulerNames</span><span class="o">=</span><span class="p">[</span><span class="s">&#39;build-all-platforms&#39;</span><span class="p">],</span>
                                   <span class="n">waitForFinish</span><span class="o">=</span><span class="bp">True</span><span class="p">))</span>
<span class="n">nightly_factory</span><span class="o">.</span><span class="n">addStep</span><span class="p">(</span><span class="n">trigger</span><span class="o">.</span><span class="n">Trigger</span><span class="p">(</span><span class="n">schedulerNames</span><span class="o">=</span><span class="p">[</span><span class="s">&#39;package-all-platforms&#39;</span><span class="p">],</span>
                                     <span class="n">waitForFinish</span><span class="o">=</span><span class="bp">True</span><span class="p">))</span>
</pre></div>
</div>
</div>
</div>


          </div>
        </div>
      </div>
        </div>
        <div class="sidebar">
<h3>Table Of Contents</h3>
<ul class="current">
<li class="toctree-l1"><a class="reference internal" href="../tutorial/index.html">Buildbot Tutorial</a></li>
<li class="toctree-l1 current"><a class="reference internal" href="index.html">Buildbot Manual</a><ul class="current">
<li class="toctree-l2"><a class="reference internal" href="introduction.html">Introduction</a></li>
<li class="toctree-l2"><a class="reference internal" href="installation.html">Installation</a></li>
<li class="toctree-l2"><a class="reference internal" href="concepts.html">Concepts</a></li>
<li class="toctree-l2 current"><a class="reference internal" href="configuration.html">Configuration</a><ul class="current">
<li class="toctree-l3"><a class="reference internal" href="cfg-intro.html">Configuring Buildbot</a></li>
<li class="toctree-l3"><a class="reference internal" href="cfg-global.html">Global Configuration</a></li>
<li class="toctree-l3"><a class="reference internal" href="cfg-changesources.html">Change Sources</a></li>
<li class="toctree-l3 current"><a class="current reference internal" href="">Schedulers</a><ul class="simple">
</ul>
</li>
<li class="toctree-l3"><a class="reference internal" href="cfg-buildslaves.html">Buildslaves</a></li>
<li class="toctree-l3"><a class="reference internal" href="cfg-builders.html">Builder Configuration</a></li>
<li class="toctree-l3"><a class="reference internal" href="cfg-buildfactories.html">Build Factories</a></li>
<li class="toctree-l3"><a class="reference internal" href="cfg-properties.html">Properties</a></li>
<li class="toctree-l3"><a class="reference internal" href="cfg-buildsteps.html">Build Steps</a></li>
<li class="toctree-l3"><a class="reference internal" href="cfg-interlocks.html">Interlocks</a></li>
<li class="toctree-l3"><a class="reference internal" href="cfg-statustargets.html">Status Targets</a></li>
</ul>
</li>
<li class="toctree-l2"><a class="reference internal" href="customization.html">Customization</a></li>
<li class="toctree-l2"><a class="reference internal" href="cmdline.html">Command-line Tool</a></li>
<li class="toctree-l2"><a class="reference internal" href="resources.html">Resources</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="../developer/index.html">Buildbot Development</a></li>
</ul>

          <h3 style="margin-top: 1.5em;">Search</h3>
          <form class="search" action="../search.html" method="get">
            <input type="text" name="q" size="18" />
            <input type="submit" value="Go" />
            <input type="hidden" name="check_keywords" value="yes" />
            <input type="hidden" name="area" value="default" />
          </form>
          <p class="searchtip" style="font-size: 90%">
            Enter search terms or a module, class or function name.
          </p>
        </div>
        <div class="clearer"></div>
      </div>
    </div>

    <div class="footer-wrapper">
      <div class="footer">
        <div class="left">
          <a href="cfg-changesources.html" title="Change Sources"
             >previous</a> |
          <a href="cfg-buildslaves.html" title="Buildslaves"
             >next</a> |
          <a href="../py-modindex.html" title="Python Module Index"
             >modules</a> |
          <a href="../genindex.html" title="General Index"
             >index</a>
            <br/>
            <a href="../_sources/manual/cfg-schedulers.txt"
               rel="nofollow">Show Source</a>
        </div>

        <div class="right">
          
    <div class="footer">
        &copy; Copyright Buildbot Team Members.
      Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.0.7.
    </div>
        </div>
        <div class="clearer"></div>
      </div>
    </div>

  </body>
</html>