Sophie

Sophie

distrib > Mageia > 6 > armv5tl > by-pkgid > 821bff9b1c6450f83fd56c64b66aa3f7 > files > 176

buildbot-doc-0.8.12-3.mga6.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>A Quick Tour &mdash; Buildbot 0.8.12 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.12',
        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 0.8.12 documentation" href="../index.html" />
    <link rel="up" title="Buildbot Tutorial" href="index.html" />
    <link rel="next" title="Further Reading" href="further.html" />
    <link rel="prev" title="First Buildbot run with Docker" href="docker.html" /> 
  </head>
  <body role="document">
    <div class="header-wrapper" role="banner">
      <div class="header">
          <p class="logo"><a href="../index.html">
            <img class="logo" src="../_static/header-text-transparent.png" alt="Logo"/>
          </a></p>
        <div class="headertitle"><a
          href="../index.html">Buildbot 0.8.12 documentation</a></div>
        <div class="rel" role="navigation" aria-label="related navigation">
          <a href="docker.html" title="First Buildbot run with Docker"
             accesskey="P">previous</a> |
          <a href="further.html" title="Further Reading"
             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" role="main">
            
  <div class="section" id="a-quick-tour">
<span id="quick-tour-label"></span><h1>A Quick Tour<a class="headerlink" href="#a-quick-tour" title="Permalink to this headline">¶</a></h1>
<div class="section" id="goal">
<h2>Goal<a class="headerlink" href="#goal" title="Permalink to this headline">¶</a></h2>
<p>This tutorial will expand on the <a class="reference internal" href="firstrun.html#first-run-label"><span class="std std-ref">First Run</span></a> tutorial by taking a quick tour around some of the features of buildbot that are hinted at in the comments in the sample configuration.
We will simply change parts of the default configuration and explain the activated features.</p>
<p>As a part of this tutorial, we will make buildbot do a few actual builds.</p>
<p>This section will teach you how to:
- make simple configuration changes and activate them
- deal with configuration errors
- force builds
- enable and control the IRC bot
- enable ssh debugging
- add a 'try' scheduler</p>
</div>
<div class="section" id="setting-project-name-and-url">
<h2>Setting Project Name and URL<a class="headerlink" href="#setting-project-name-and-url" title="Permalink to this headline">¶</a></h2>
<p>Let's start simple by looking at where you would customize the buildbot's project name and URL.</p>
<p>We continue where we left off in the <a class="reference internal" href="firstrun.html#first-run-label"><span class="std std-ref">First Run</span></a> tutorial.</p>
<p>Open a new terminal, and first enter the same sandbox you created before (where <code class="docutils literal"><span class="pre">$EDITOR</span></code> is your editor of choice like vim, gedit, or emacs):</p>
<div class="highlight-bash"><div class="highlight"><pre><span></span><span class="nb">cd</span>
<span class="nb">cd</span> tmp/buildbot
<span class="nb">source</span> sandbox/bin/activate
<span class="nv">$EDITOR</span> master/master.cfg
</pre></div>
</div>
<p>Now, look for the section marked <em>PROJECT IDENTITY</em> which reads:</p>
<div class="highlight-default"><div class="highlight"><pre><span></span><span class="c1">####### PROJECT IDENTITY</span>

<span class="c1"># the &#39;title&#39; string will appear at the top of this buildbot</span>
<span class="c1"># installation&#39;s html.WebStatus home page (linked to the</span>
<span class="c1"># &#39;titleURL&#39;) and is embedded in the title of the waterfall HTML page.</span>

<span class="n">c</span><span class="p">[</span><span class="s1">&#39;title&#39;</span><span class="p">]</span> <span class="o">=</span> <span class="s2">&quot;Pyflakes&quot;</span>
<span class="n">c</span><span class="p">[</span><span class="s1">&#39;titleURL&#39;</span><span class="p">]</span> <span class="o">=</span> <span class="s2">&quot;http://divmod.org/trac/wiki/DivmodPyflakes&quot;</span>
</pre></div>
</div>
<p>If you want, you can change either of these links to anything you want to see what happens when you change them.</p>
<p>After making a change go into the terminal and type:</p>
<div class="highlight-bash"><div class="highlight"><pre><span></span>buildbot reconfig master
</pre></div>
</div>
<p>You will see a handful of lines of output from the master log, much like this:</p>
<div class="highlight-none"><div class="highlight"><pre><span></span>2011-12-04 10:11:09-0600 [-] loading configuration from /home/dustin/tmp/buildbot/master/master.cfg
2011-12-04 10:11:09-0600 [-] configuration update started
2011-12-04 10:11:09-0600 [-] builder runtests is unchanged
2011-12-04 10:11:09-0600 [-] removing IStatusReceiver &lt;WebStatus on port tcp:8010 at 0x2aee368&gt;
2011-12-04 10:11:09-0600 [-] (TCP Port 8010 Closed)
2011-12-04 10:11:09-0600 [-] Stopping factory &lt;buildbot.status.web.baseweb.RotateLogSite instance at 0x2e36638&gt;
2011-12-04 10:11:09-0600 [-] adding IStatusReceiver &lt;WebStatus on port tcp:8010 at 0x2c2d950&gt;
2011-12-04 10:11:09-0600 [-] RotateLogSite starting on 8010
2011-12-04 10:11:09-0600 [-] Starting factory &lt;buildbot.status.web.baseweb.RotateLogSite instance at 0x2e36e18&gt;
2011-12-04 10:11:09-0600 [-] Setting up http.log rotating 10 files of 10000000 bytes each
2011-12-04 10:11:09-0600 [-] WebStatus using (/home/dustin/tmp/buildbot/master/public_html)
2011-12-04 10:11:09-0600 [-] removing 0 old schedulers, updating 0, and adding 0
2011-12-04 10:11:09-0600 [-] adding 1 new changesources, removing 1
2011-12-04 10:11:09-0600 [-] gitpoller: using workdir &#39;/home/dustin/tmp/buildbot/master/gitpoller-workdir&#39;
2011-12-04 10:11:09-0600 [-] GitPoller repository already exists
2011-12-04 10:11:09-0600 [-] configuration update complete

Reconfiguration appears to have completed successfully.
</pre></div>
</div>
<p>The important lines are the ones telling you that it is loading the new configuration at the top, and the one at the bottom saying that the update is complete.</p>
<p>Now, if you go back to <a class="reference external" href="http://localhost:8010/waterfall">the waterfall page</a>, you will see that the project's name is whatever you may have changed it to and when you click on the URL of the project name at the bottom of the page it should take you to the link you put in the configuration.</p>
</div>
<div class="section" id="configuration-errors">
<h2>Configuration Errors<a class="headerlink" href="#configuration-errors" title="Permalink to this headline">¶</a></h2>
<p>It is very common to make a mistake when configuring buildbot, so you might as well see now what happens in that case and what you can do to fix the error.</p>
<p>Open up the config again and introduce a syntax error by removing the first single quote in the two lines you changed, so they read:</p>
<div class="highlight-default"><div class="highlight"><pre><span></span><span class="n">c</span><span class="p">[</span><span class="s1">&#39;title&#39;</span><span class="p">]</span> <span class="o">=</span> <span class="s2">&quot;Pyflakes&quot;</span>
<span class="n">c</span><span class="p">[</span><span class="s1">&#39;titleURL&#39;</span><span class="p">]</span> <span class="o">=</span> <span class="s2">&quot;http://divmod.org/trac/wiki/DivmodPyflakes&quot;</span>
</pre></div>
</div>
<p>This creates a Python SyntaxError.
Now go ahead and reconfig the buildmaster:</p>
<div class="highlight-bash"><div class="highlight"><pre><span></span>buildbot reconfig master
</pre></div>
</div>
<p>This time, the output looks like:</p>
<div class="highlight-none"><div class="highlight"><pre><span></span>2011-12-04 10:12:28-0600 [-] loading configuration from /home/dustin/tmp/buildbot/master/master.cfg
2011-12-04 10:12:28-0600 [-] configuration update started
2011-12-04 10:12:28-0600 [-] error while parsing config file
2011-12-04 10:12:28-0600 [-] Unhandled Error
        Traceback (most recent call last):
        File &quot;/home/dustin/tmp/buildbot/sandbox/lib/python2.7/site-packages/buildbot-0.8.5-py2.7.egg/buildbot/master.py&quot;, line 197, in loadTheConfigFile
            d = self.loadConfig(f)
        File &quot;/home/dustin/tmp/buildbot/sandbox/lib/python2.7/site-packages/buildbot-0.8.5-py2.7.egg/buildbot/master.py&quot;, line 579, in loadConfig
            d.addCallback(do_load)
        File &quot;/home/dustin/tmp/buildbot/sandbox/lib/python2.7/site-packages/Twisted-11.1.0-py2.7-linux-x86_64.egg/twisted/internet/defer.py&quot;, line 298, in addCallback
            callbackKeywords=kw)
        File &quot;/home/dustin/tmp/buildbot/sandbox/lib/python2.7/site-packages/Twisted-11.1.0-py2.7-linux-x86_64.egg/twisted/internet/defer.py&quot;, line 287, in addCallbacks
            self._runCallbacks()
        --- &lt;exception caught here&gt; ---
        File &quot;/home/dustin/tmp/buildbot/sandbox/lib/python2.7/site-packages/Twisted-11.1.0-py2.7-linux-x86_64.egg/twisted/internet/defer.py&quot;, line 545, in _runCallbacks
            current.result = callback(current.result, *args, **kw)
        File &quot;/home/dustin/tmp/buildbot/sandbox/lib/python2.7/site-packages/buildbot-0.8.5-py2.7.egg/buildbot/master.py&quot;, line 226, in do_load
            exec f in localDict
        exceptions.SyntaxError: EOL while scanning string literal (master.cfg, line 17)

Never saw reconfiguration finish.
</pre></div>
</div>
<p>This time, it's clear that there was a mistake in the configuration.
Luckily, the buildbot master will ignore the wrong configuration and keep running with the previous configuration.</p>
<p>The message is clear enough, so open the configuration again, fix the error, and reconfig the master.</p>
</div>
<div class="section" id="your-first-build">
<h2>Your First Build<a class="headerlink" href="#your-first-build" title="Permalink to this headline">¶</a></h2>
<p>By now you're probably thinking: &quot;All this time spent and still not done a single build?
What was the name of this project again?&quot;</p>
<p>On the <a class="reference external" href="http://localhost:8010/waterfall">waterfall</a> page, click on the runtests link.
You'll see a builder page, and in the upper-right corner is a box where you can login.
The default username and password are both &quot;pyflakes&quot;.
Once you've logged in, you will see some new options that allow you to force a build:</p>
<img alt="force a build." src="../_images/force-build.png" />
<p>Click <em>Force Build</em> - there's no need to fill in any of the fields in this case.
Next, click on <a class="reference external" href="http://localhost:8010/waterfall?show=runtests">view in waterfall</a>.</p>
<p>You will now see:</p>
<img alt="an successful test run happened." src="../_images/runtests-success.png" />
</div>
<div class="section" id="enabling-the-irc-bot">
<h2>Enabling the IRC Bot<a class="headerlink" href="#enabling-the-irc-bot" title="Permalink to this headline">¶</a></h2>
<p>Buildbot includes an IRC bot that you can tell to join a channel and control to report on the status of buildbot.</p>
<p>First, start an IRC client of your choice, connect to irc.freenode.org and join an empty channel.
In this example we will use #buildbot-test, so go join that channel.
(<em>Note: please do not join the main buildbot channel!</em>)</p>
<p>Edit the config and look for the <em>STATUS TARGETS</em> section.
Enter these lines below the WebStatus line in master.cfg:</p>
<div class="highlight-default"><div class="highlight"><pre><span></span><span class="kn">from</span> <span class="nn">buildbot.plugins</span> <span class="k">import</span> <span class="n">status</span>

<span class="n">c</span><span class="p">[</span><span class="s1">&#39;status&#39;</span><span class="p">]</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="n">status</span><span class="o">.</span><span class="n">WebStatus</span><span class="p">(</span><span class="n">http_port</span><span class="o">=</span><span class="mi">8010</span><span class="p">,</span> <span class="n">authz</span><span class="o">=</span><span class="n">authz_cfg</span><span class="p">))</span>
<span class="n">c</span><span class="p">[</span><span class="s1">&#39;status&#39;</span><span class="p">]</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="n">status</span><span class="o">.</span><span class="n">IRC</span><span class="p">(</span><span class="n">host</span><span class="o">=</span><span class="s2">&quot;irc.freenode.org&quot;</span><span class="p">,</span> <span class="n">nick</span><span class="o">=</span><span class="s2">&quot;bbtest&quot;</span><span class="p">,</span>
                              <span class="n">channels</span><span class="o">=</span><span class="p">[</span><span class="s2">&quot;#buildbot-test&quot;</span><span class="p">]))</span>
</pre></div>
</div>
<p>Reconfigure the build master then do:</p>
<div class="highlight-bash"><div class="highlight"><pre><span></span>grep -i irc master/twistd.log
</pre></div>
</div>
<p>The log output should contain a line like this:</p>
<div class="highlight-none"><div class="highlight"><pre><span></span>2009-08-01 15:35:20+0200 [-] adding IStatusReceiver &lt;buildbot.status.words.IRC instance at 0x300d290&gt;
</pre></div>
</div>
<p>You should see the bot now joining in your IRC client.
In your IRC channel, type:</p>
<div class="highlight-none"><div class="highlight"><pre><span></span>bbtest: commands
</pre></div>
</div>
<p>to get a list of the commands the bot supports.</p>
<p>Let's tell the bot to notify certain events, to learn which EVENTS we can notify on:</p>
<div class="highlight-none"><div class="highlight"><pre><span></span>bbtest: help notify
</pre></div>
</div>
<p>Now let's set some event notifications:</p>
<div class="highlight-none"><div class="highlight"><pre><span></span>bbtest: notify on started
bbtest: notify on finished
bbtest: notify on failure
</pre></div>
</div>
<p>The bot should have responded to each of the commands:</p>
<div class="highlight-irc"><div class="highlight"><pre><span></span><span class="nt">&lt;@lsblakk&gt; </span><span class="na">bbtest:</span> notify on started
<span class="nt">&lt;bbtest&gt; </span>The following events are being notified: [&#39;started&#39;]
<span class="nt">&lt;@lsblakk&gt; </span><span class="na">bbtest:</span> notify on finished
<span class="nt">&lt;bbtest&gt; </span>The following events are being notified: [&#39;started&#39;, &#39;finished&#39;]
<span class="nt">&lt;@lsblakk&gt; </span><span class="na">bbtest:</span> notify on failure
<span class="nt">&lt;bbtest&gt; </span>The following events are being notified: [&#39;started&#39;, &#39;failure&#39;, &#39;finished&#39;]
</pre></div>
</div>
<p>Now, go back to the web interface and force another build.</p>
<p>Notice how the bot tells you about the start and finish of this build:</p>
<div class="highlight-irc"><div class="highlight"><pre><span></span><span class="nt">&lt; bbtest&gt; </span>build #1 of runtests started, including []
<span class="nt">&lt; bbtest&gt; </span>build #1 of runtests is complete: Success [build successful]  Build details are at http://localhost:8010/builders/runtests/builds/1
</pre></div>
</div>
<p>You can also use the bot to force a build:</p>
<div class="highlight-none"><div class="highlight"><pre><span></span>bbtest: force build runtests test build
</pre></div>
</div>
<p>But to allow this, you'll need to have <code class="docutils literal"><span class="pre">allowForce</span></code> in the IRC configuration:</p>
<div class="highlight-default"><div class="highlight"><pre><span></span><span class="n">c</span><span class="p">[</span><span class="s1">&#39;status&#39;</span><span class="p">]</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="n">words</span><span class="o">.</span><span class="n">IRC</span><span class="p">(</span><span class="n">host</span><span class="o">=</span><span class="s2">&quot;irc.freenode.org&quot;</span><span class="p">,</span> <span class="n">nick</span><span class="o">=</span><span class="s2">&quot;bbtest&quot;</span><span class="p">,</span>
                             <span class="n">allowForce</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span>
                             <span class="n">channels</span><span class="o">=</span><span class="p">[</span><span class="s2">&quot;#buildbot-test&quot;</span><span class="p">]))</span>
</pre></div>
</div>
<p>This time, the bot is giving you more output, as it's specifically responding to your direct request to force a build, and explicitly tells you when the build finishes:</p>
<div class="highlight-irc"><div class="highlight"><pre><span></span><span class="nt">&lt;@lsblakk&gt; </span><span class="na">bbtest:</span> force build runtests test build
<span class="nt">&lt; bbtest&gt; </span>build #2 of runtests started, including []
<span class="nt">&lt; bbtest&gt; </span>build forced [ETA 0 seconds]
<span class="nt">&lt; bbtest&gt; </span>I&#39;ll give a shout when the build finishes
<span class="nt">&lt; bbtest&gt; </span>build #2 of runtests is complete: Success [build successful]  Build details are at http://localhost:8010/builders/runtests/builds/2
</pre></div>
</div>
<p>You can also see the new builds in the web interface.</p>
<img alt="a successful test run from IRC happened." src="../_images/irc-testrun.png" />
</div>
<div class="section" id="setting-authorized-web-users">
<h2>Setting Authorized Web Users<a class="headerlink" href="#setting-authorized-web-users" title="Permalink to this headline">¶</a></h2>
<p>Further down, look for the WebStatus configuration:</p>
<div class="highlight-default"><div class="highlight"><pre><span></span><span class="kn">from</span> <span class="nn">buildbot.plugins</span> <span class="k">import</span> <span class="n">status</span><span class="p">,</span> <span class="n">util</span>

<span class="n">c</span><span class="p">[</span><span class="s1">&#39;status&#39;</span><span class="p">]</span> <span class="o">=</span> <span class="p">[]</span>

<span class="n">authz_cfg</span><span class="o">=</span><span class="n">util</span><span class="o">.</span><span class="n">Authz</span><span class="p">(</span>
    <span class="c1"># change any of these to True to enable; see the manual for more</span>
    <span class="c1"># options</span>
    <span class="n">auth</span><span class="o">=</span><span class="n">util</span><span class="o">.</span><span class="n">BasicAuth</span><span class="p">([(</span><span class="s2">&quot;pyflakes&quot;</span><span class="p">,</span><span class="s2">&quot;pyflakes&quot;</span><span class="p">)]),</span>
    <span class="n">gracefulShutdown</span><span class="o">=</span><span class="kc">False</span><span class="p">,</span>
    <span class="n">forceBuild</span><span class="o">=</span><span class="s1">&#39;auth&#39;</span><span class="p">,</span> <span class="c1"># use this to test your slave once it is set up</span>
    <span class="n">forceAllBuilds</span><span class="o">=</span><span class="kc">False</span><span class="p">,</span>
    <span class="n">pingBuilder</span><span class="o">=</span><span class="kc">False</span><span class="p">,</span>
    <span class="n">stopBuild</span><span class="o">=</span><span class="kc">False</span><span class="p">,</span>
    <span class="n">stopAllBuilds</span><span class="o">=</span><span class="kc">False</span><span class="p">,</span>
    <span class="n">cancelPendingBuild</span><span class="o">=</span><span class="kc">False</span><span class="p">,</span>
<span class="p">)</span>
<span class="n">c</span><span class="p">[</span><span class="s1">&#39;status&#39;</span><span class="p">]</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="n">status</span><span class="o">.</span><span class="n">WebStatus</span><span class="p">(</span><span class="n">http_port</span><span class="o">=</span><span class="mi">8010</span><span class="p">,</span> <span class="n">authz</span><span class="o">=</span><span class="n">authz_cfg</span><span class="p">))</span>
</pre></div>
</div>
<p>The <code class="docutils literal"><span class="pre">util.BasicAuth()</span></code> define authorized users and their passwords.
You can change these or add new ones.
See <a class="reference internal" href="../manual/cfg-statustargets.html#status-WebStatus" title="WebStatus"><code class="xref bb bb-status docutils literal"><span class="pre">WebStatus</span></code></a> for more about the WebStatus configuration.</p>
</div>
<div class="section" id="debugging-with-manhole">
<h2>Debugging with Manhole<a class="headerlink" href="#debugging-with-manhole" title="Permalink to this headline">¶</a></h2>
<p>You can do some debugging by using manhole, an interactive Python shell.
It exposes full access to the buildmaster's account (including the ability to modify and delete files), so it should not be enabled with a weak or easily guessable password.</p>
<p>To use this you will need to install an additional package or two to your virtualenv:</p>
<div class="highlight-bash"><div class="highlight"><pre><span></span><span class="nb">cd</span>
<span class="nb">cd</span> tmp/buildbot
<span class="nb">source</span> sandbox/bin/activate
easy_install pycrypto
easy_install pyasn1
</pre></div>
</div>
<p>In your master.cfg find:</p>
<div class="highlight-default"><div class="highlight"><pre><span></span><span class="n">c</span> <span class="o">=</span> <span class="n">BuildmasterConfig</span> <span class="o">=</span> <span class="p">{}</span>
</pre></div>
</div>
<p>Insert the following to enable debugging mode with manhole:</p>
<div class="highlight-default"><div class="highlight"><pre><span></span><span class="c1">####### DEBUGGING</span>
<span class="kn">from</span> <span class="nn">buildbot.plugins</span> <span class="k">import</span> <span class="n">util</span>

<span class="n">c</span><span class="p">[</span><span class="s1">&#39;manhole&#39;</span><span class="p">]</span> <span class="o">=</span> <span class="n">util</span><span class="o">.</span><span class="n">PasswordManhole</span><span class="p">(</span><span class="s2">&quot;tcp:1234:interface=127.0.0.1&quot;</span><span class="p">,</span> <span class="s2">&quot;admin&quot;</span><span class="p">,</span> <span class="s2">&quot;passwd&quot;</span><span class="p">)</span>
</pre></div>
</div>
<p>After restarting the master, you can ssh into the master and get an interactive Python shell:</p>
<div class="highlight-bash"><div class="highlight"><pre><span></span>ssh -p1234 admin@127.0.0.1
<span class="c1"># enter passwd at prompt</span>
</pre></div>
</div>
<div class="admonition note">
<p class="first admonition-title">Note</p>
<p>The pyasn1-0.1.1 release has a bug which results in an exception similar to this on startup:</p>
<div class="highlight-none"><div class="highlight"><pre><span></span>exceptions.TypeError: argument 2 must be long, not int
</pre></div>
</div>
<p>If you see this, the temporary solution is to install the previous version of pyasn1:</p>
<div class="last highlight-bash"><div class="highlight"><pre><span></span>pip install pyasn1-0.0.13b
</pre></div>
</div>
</div>
<p>If you wanted to check which slaves are connected and what builders those slaves are assigned to you could do:</p>
<div class="highlight-default"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">master</span><span class="o">.</span><span class="n">botmaster</span><span class="o">.</span><span class="n">slaves</span>
<span class="go">{&#39;example-slave&#39;: &lt;BuildSlave &#39;example-slave&#39;, current builders: runtests&gt;}</span>
</pre></div>
</div>
<p>Objects can be explored in more depth using <cite>dir(x)</cite> or the helper function <cite>show(x)</cite>.</p>
</div>
<div class="section" id="adding-a-try-scheduler">
<h2>Adding a 'try' scheduler<a class="headerlink" href="#adding-a-try-scheduler" title="Permalink to this headline">¶</a></h2>
<p>Buildbot includes a way for developers to submit patches for testing without committing them to the source code control system.
(This is really handy for projects that support several operating systems or architectures.)</p>
<p>To set this up, add the following lines to master.cfg:</p>
<div class="highlight-default"><div class="highlight"><pre><span></span><span class="kn">from</span> <span class="nn">buildbot.plugins</span> <span class="k">import</span> <span class="n">schedulers</span>

<span class="n">c</span><span class="p">[</span><span class="s1">&#39;schedulers&#39;</span><span class="p">]</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="n">schedulers</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="s1">&#39;try&#39;</span><span class="p">,</span>
                                               <span class="n">builderNames</span><span class="o">=</span><span class="p">[</span><span class="s1">&#39;runtests&#39;</span><span class="p">],</span>
                                               <span class="n">port</span><span class="o">=</span><span class="mi">5555</span><span class="p">,</span>
                                               <span class="n">userpass</span><span class="o">=</span><span class="p">[(</span><span class="s1">&#39;sampleuser&#39;</span><span class="p">,</span><span class="s1">&#39;samplepass&#39;</span><span class="p">)]))</span>
</pre></div>
</div>
<p>Then you can submit changes using the <a class="reference internal" href="../manual/cmdline.html#cmdline-try" title="try"><code class="xref bb bb-cmdline docutils literal"><span class="pre">try</span></code></a> command.</p>
<p>Let's try this out by making a one-line change to pyflakes, say, to make it trace the tree by default:</p>
<div class="highlight-bash"><div class="highlight"><pre><span></span>git clone git://github.com/buildbot/pyflakes.git pyflakes-git
<span class="nb">cd</span> pyflakes-git/pyflakes
<span class="nv">$EDITOR</span> checker.py
<span class="c1"># change &quot;traceTree = False&quot; on line 185 to &quot;traceTree = True&quot;</span>
</pre></div>
</div>
<p>Then run buildbot's <code class="docutils literal"><span class="pre">try</span></code> command as follows:</p>
<div class="highlight-bash"><div class="highlight"><pre><span></span><span class="nb">source</span> ~/tmp/buildbot/sandbox/bin/activate
buildbot try --connect<span class="o">=</span>pb --master<span class="o">=</span>127.0.0.1:5555 --username<span class="o">=</span>sampleuser --passwd<span class="o">=</span>samplepass --vc<span class="o">=</span>git
</pre></div>
</div>
<p>This will do <code class="docutils literal"><span class="pre">git</span> <span class="pre">diff</span></code> for you and send the resulting patch to the server for build and test against the latest sources from Git.</p>
<p>Now go back to the <a class="reference external" href="http://localhost:8010/waterfall">waterfall</a> page, click on the runtests link, and scroll down.
You should see that another build has been started with your change (and stdout for the tests should be chock-full of parse trees as a result).
The &quot;Reason&quot; for the job will be listed as &quot;'try' job&quot;, and the blamelist will be empty.</p>
<p>To make yourself show up as the author of the change, use the <code class="docutils literal"><span class="pre">--who=emailaddr</span></code> option on <code class="docutils literal"><span class="pre">buildbot</span> <span class="pre">try</span></code> to pass your email address.</p>
<p>To make a description of the change show up, use the <code class="docutils literal"><span class="pre">--properties=comment=&quot;this</span> <span class="pre">is</span> <span class="pre">a</span> <span class="pre">comment&quot;</span></code> option on <code class="docutils literal"><span class="pre">buildbot</span> <span class="pre">try</span></code>.</p>
<p>To use ssh instead of a private username/password database, see <a class="reference internal" href="../manual/cfg-schedulers.html#sched-Try_Jobdir" title="Try_Jobdir"><code class="xref bb bb-sched docutils literal"><span class="pre">Try_Jobdir</span></code></a>.</p>
</div>
</div>


          </div>
        </div>
      </div>
        </div>
        <div class="sidebar">
<h3>Table Of Contents</h3>
<ul class="current">
<li class="toctree-l1 current"><a class="reference internal" href="index.html">Buildbot Tutorial</a><ul class="current">
<li class="toctree-l2"><a class="reference internal" href="firstrun.html">First Run</a></li>
<li class="toctree-l2"><a class="reference internal" href="docker.html">First Buildbot run with Docker</a></li>
<li class="toctree-l2 current"><a class="current reference internal" href="#">A Quick Tour</a><ul class="simple">
</ul>
</li>
<li class="toctree-l2"><a class="reference internal" href="further.html">Further Reading</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="../manual/index.html">Buildbot Manual</a></li>
<li class="toctree-l1"><a class="reference internal" href="../developer/index.html">Buildbot Development</a></li>
<li class="toctree-l1"><a class="reference internal" href="../relnotes/index.html">Release Notes for Buildbot 0.8.12</a></li>
</ul>

          <div role="search">
            <h3 style="margin-top: 1.5em;">Search</h3>
            <form class="search" action="../search.html" method="get">
                <input type="text" name="q" />
                <input type="submit" value="Go" />
                <input type="hidden" name="check_keywords" value="yes" />
                <input type="hidden" name="area" value="default" />
            </form>
          </div>
        </div>
        <div class="clearer"></div>
      </div>
    </div>

    <div class="footer-wrapper">
      <div class="footer">
        <div class="left">
          <div role="navigation" aria-label="related navigaton">
            <a href="docker.html" title="First Buildbot run with Docker"
              >previous</a> |
            <a href="further.html" title="Further Reading"
              >next</a> |
            <a href="../py-modindex.html" title="Python Module Index"
              >modules</a> |
            <a href="../genindex.html" title="General Index"
              >index</a>
          </div>
          <div role="note" aria-label="source link">
              <br/>
              <a href="../_sources/tutorial/tour.txt"
                rel="nofollow">Show Source</a>
          </div>
        </div>

        <div class="right">
          
    <div class="footer" role="contentinfo">
        &copy; Copyright Buildbot Team Members.
      Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.4.1.
    </div>
        </div>
        <div class="clearer"></div>
      </div>
    </div>

  </body>
</html>