Skip to content

Commit

Permalink
update tutorial/tour.rst
Browse files Browse the repository at this point in the history
* remove trailing spaces
* make text compliant with one-sentect-per-line guidline
* minor formatting fixes
  • Loading branch information
Mikhail Sobolev committed Jan 11, 2015
1 parent 3237b47 commit bd16f20
Showing 1 changed file with 53 additions and 83 deletions.
136 changes: 53 additions & 83 deletions master/docs/tutorial/tour.rst
Expand Up @@ -7,20 +7,18 @@ A Quick Tour
Goal
----

This tutorial will expand on the :ref:`first-run-label` 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.
This tutorial will expand on the :ref:`first-run-label` 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.

As a part of this tutorial, we will make buildbot do a few actual builds.

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
- 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

Setting Project Name and URL
----------------------------
Expand Down Expand Up @@ -49,7 +47,7 @@ Now, look for the section marked *PROJECT IDENTITY* which reads::
c['title'] = "Pyflakes"
c['titleURL'] = "http://divmod.org/trac/wiki/DivmodPyflakes"

If you want, you can change either of these links to anything you want to see what happens when you change them.
If you want, you can change either of these links to anything you want to see what happens when you change them.

After making a change go into the terminal and type:

Expand Down Expand Up @@ -80,29 +78,22 @@ You will see a handful of lines of output from the master log, much like this:
Reconfiguration appears to have completed successfully.
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.
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.

Now, if you go back to
`the waterfall page <http://localhost:8010/waterfall>`_,
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.
Now, if you go back to `the waterfall page <http://localhost:8010/waterfall>`_, 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.

Configuration Errors
--------------------

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.
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.

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::
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::

c['title'] = "Pyflakes"
c['titleURL'] = "http://divmod.org/trac/wiki/DivmodPyflakes"

This creates a Python SyntaxError. Now go ahead and reconfig the buildmaster:
This creates a Python SyntaxError.
Now go ahead and reconfig the buildmaster:

.. code-block:: bash
Expand Down Expand Up @@ -134,31 +125,27 @@ This time, the output looks like:
Never saw reconfiguration finish.
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.
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.

The message is clear enough, so open the configuration again, fix the error,
and reconfig the master.
The message is clear enough, so open the configuration again, fix the error, and reconfig the master.

Your First Build
----------------

By now you're probably thinking: "All this time spent and still not done a
single build? What was the name of this project again?"
By now you're probably thinking: "All this time spent and still not done a single build?
What was the name of this project again?"

On the `waterfall <http://localhost:8010/waterfall>`_. 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
"pyflakes". Once you've logged in, you will see some new options that allow
you to force a build:
On the `waterfall <http://localhost:8010/waterfall>`_ 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 "pyflakes".
Once you've logged in, you will see some new options that allow you to force a build:

.. image:: _images/force-build.png
:alt: force a build.

Click *Force Build* - there's no need to fill in any of the fields in this
case. Next, click on `view in waterfall
<http://localhost:8010/waterfall?show=runtests>`_.
Click *Force Build* - there's no need to fill in any of the fields in this case.
Next, click on `view in waterfall <http://localhost:8010/waterfall?show=runtests>`_.

You will now see:

Expand All @@ -168,15 +155,14 @@ You will now see:
Enabling the IRC Bot
--------------------

Buildbot includes an IRC bot that you can tell to join a channel and control
to report on the status of buildbot.
Buildbot includes an IRC bot that you can tell to join a channel and control to report on the status of buildbot.

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. (*Note: please do not join the main buildbot channel!*)
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.
(*Note: please do not join the main buildbot channel!*)

Edit the config and look for the *STATUS TARGETS* section. Enter these lines
below the WebStatus line in master.cfg::
Edit the config and look for the *STATUS TARGETS* section.
Enter these lines below the WebStatus line in master.cfg::

c['status'].append(html.WebStatus(http_port=8010, authz=authz_cfg))

Expand Down Expand Up @@ -245,16 +231,13 @@ You can also use the bot to force a build:
bbtest: force build runtests test build
But to allow this, you'll need to have ``allowForce`` in the IRC
configuration::
But to allow this, you'll need to have ``allowForce`` in the IRC configuration::

c['status'].append(words.IRC(host="irc.freenode.org", nick="bbtest",
allowForce=True,
channels=["#buildbot-test"]))

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:
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:

.. code-block:: irc
Expand Down Expand Up @@ -293,17 +276,15 @@ Further down, look for the WebStatus configuration::
)
c['status'].append(html.WebStatus(http_port=8010, authz=authz_cfg))

The ``auth.BasicAuth()`` define authorized users and their passwords. You can
change these or add new ones. See :bb:status:`WebStatus` for more about the
WebStatus configuration.
The ``auth.BasicAuth()`` define authorized users and their passwords.
You can change these or add new ones.
See :bb:status:`WebStatus` for more about the WebStatus configuration.

Debugging with Manhole
----------------------

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.
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.

To use this you will need to install an additional package or two to your virtualenv:

Expand Down Expand Up @@ -333,15 +314,14 @@ After restarting the master, you can ssh into the master and get an interactive
# enter passwd at prompt
.. note::
The pyasn1-0.1.1 release has a bug which results in an exception similar to
this on startup:

The pyasn1-0.1.1 release has a bug which results in an exception similar to this on startup:

.. code-block:: none
exceptions.TypeError: argument 2 must be long, not int
If you see this, the temporary solution is to install the previous version
of pyasn1:
If you see this, the temporary solution is to install the previous version of pyasn1:

.. code-block:: bash
Expand All @@ -352,15 +332,13 @@ If you wanted to check which slaves are connected and what builders those slaves
>>> master.botmaster.slaves
{'example-slave': <BuildSlave 'example-slave', current builders: runtests>}

Objects can be explored in more depth using `dir(x)` or the helper function
`show(x)`.
Objects can be explored in more depth using `dir(x)` or the helper function `show(x)`.

Adding a 'try' scheduler
------------------------

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.)
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.)

To set this up, add the following lines to master.cfg::

Expand All @@ -373,8 +351,7 @@ To set this up, add the following lines to master.cfg::

Then you can submit changes using the :bb:cmdline:`try` command.

Let's try this out by making a one-line change to pyflakes, say,
to make it trace the tree by default:
Let's try this out by making a one-line change to pyflakes, say, to make it trace the tree by default:

.. code-block:: bash
Expand All @@ -390,21 +367,14 @@ Then run buildbot's ``try`` command as follows:
source ~/tmp/buildbot/sandbox/bin/activate
buildbot try --connect=pb --master=127.0.0.1:5555 --username=sampleuser --passwd=samplepass --vc=git
This will do ``git diff`` for you and send the resulting patch to
the server for build and test against the latest sources from Git.

Now go back to the `waterfall <http://localhost:8010/waterfall>`_
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 "Reason" for the
job will be listed as "'try' job", and the blamelist will be empty.
This will do ``git diff`` for you and send the resulting patch to the server for build and test against the latest sources from Git.

To make yourself show up as the author of the change, use the ``--who=emailaddr``
option on ``buildbot try`` to pass your email address.
Now go back to the `waterfall <http://localhost:8010/waterfall>`_ 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 "Reason" for the job will be listed as "'try' job", and the blamelist will be empty.

To make a description of the change show up, use the
``--properties=comment="this is a comment"`` option on ``buildbot try``.
To make yourself show up as the author of the change, use the ``--who=emailaddr`` option on ``buildbot try`` to pass your email address.

To use ssh instead of a private username/password database, see
:bb:sched:`Try_Jobdir`.
To make a description of the change show up, use the ``--properties=comment="this is a comment"`` option on ``buildbot try``.

To use ssh instead of a private username/password database, see :bb:sched:`Try_Jobdir`.

0 comments on commit bd16f20

Please sign in to comment.