Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Mikhail Sobolev
committed
Aug 14, 2014
1 parent
e2f3548
commit 6f497b4
Showing
17 changed files
with
925 additions
and
770 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,86 @@ | ||
=============================== | ||
How to package Buildbot plugins | ||
=============================== | ||
|
||
If you customized an existing component (see :doc:`../manual/customization`) or created a new component that you believe might be useful for others, you have two options: | ||
|
||
* submit the change to the Buildbot main tree, however you need to adhere to certain requirements (see :doc:`style`) | ||
* prepare a Python package that contains the functionality you created | ||
|
||
Here we cover the second option. | ||
|
||
Package the source | ||
================== | ||
|
||
To begin with, you must package your changes. | ||
If you do not know what a Python package is, these two tutorials will get you going: | ||
|
||
* `Installation and Packaging Tutorial <https://packaging.python.org/en/latest/tutorial.html#creating-your-own-project>`_ | ||
* `The Hitchhiker’s Guide to Packaging <http://guide.python-distribute.org/index.html>`_ | ||
|
||
The former is more recent and, while it addresses everything that you need to know about Python packages, is still work in progress. | ||
The latter is a bit dated, though it was the most complete guide for quite some time available for Python developers looking to package their software. | ||
|
||
You may also want to check the `sample project <https://github.com/pypa/sampleproject>`_, which exemplifies the best Python packaging practices. | ||
|
||
Making the plugin package | ||
========================= | ||
|
||
Buildbot supports several kinds of pluggable components: | ||
|
||
* ``buildslave`` | ||
* ``changes`` | ||
* ``schedulers`` | ||
* ``steps`` | ||
* ``status`` | ||
* ``util`` | ||
|
||
(these are described in :doc:`../manual/plugins`), and | ||
|
||
* ``www`` | ||
|
||
which is described in :doc:`web server configuration <../manual/cfg-www>`. | ||
|
||
Once you have your component packaged, it's quite straightforward: you just need to add a few lines to the ``entry_points`` parameter of your call of ``setup`` function in :file:`setup.py` file:: | ||
|
||
setup( | ||
... | ||
entry_points = { | ||
..., | ||
'buildbot.kind': [ | ||
'PluginName = PluginModule:PluginClass' | ||
] | ||
}, | ||
... | ||
) | ||
|
||
(You might have seen different ways to specify the value for ``entry_points``, however they all do the same thing. | ||
Full description of possible ways is available in `setuptools documentation <http://pythonhosted.org/setuptools/setuptools.html#dynamic-discovery-of-services-and-plugins>`_.) | ||
|
||
After the :file:`setup.py` file is updated, you can build and install it:: | ||
|
||
$ python setup.py build | ||
$ sudo python setup.py install | ||
|
||
(depending on your particular setup, you might not need to use :command:`sudo`). | ||
|
||
After that the plugin should be available for Buildbot and you can use it in your :file:`master.cfg` as:: | ||
|
||
from buildbot.kind import PluginName | ||
|
||
... PluginName ... | ||
|
||
Publish the package | ||
=================== | ||
|
||
This is the last step before the plugin is available to others. | ||
|
||
Once again, there is a number of options available for you: | ||
|
||
* just put a link to your version control system | ||
* prepare a source tarball with the plugin (``python setup.py sdist``) | ||
* or publish it on `PyPI <https://pypi.python.org>`_ | ||
|
||
The last option is probably the best one since it will make your plugin available pretty much to all Python developers. | ||
|
||
Once you have published the package, please send a link to `buildbot-devel <mailto:buildbot-devel@lists.sourceforge.net>`_ mailing list, so we can include a link to your plugin to :doc:`../manual/plugins`. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -29,12 +29,11 @@ A :class:`BuildFactory` defines the steps that every build will follow. Think o | |
a glorified script. For example, a build factory which consists of an SVN checkout | ||
followed by a ``make build`` would be configured as follows:: | ||
|
||
from buildbot.steps import svn, shell | ||
from buildbot.process import factory | ||
from buildbot.plugins import util, steps | ||
|
||
f = factory.BuildFactory() | ||
f.addStep(svn.SVN(svnurl="http://..", mode="incremental")) | ||
f.addStep(shell.Compile(command=["make", "build"])) | ||
f = util.BuildFactory() | ||
f.addStep(steps.SVN(svnurl="http://..", mode="incremental")) | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
sa2ajj
Contributor
|
||
f.addStep(steps.Compile(command=["make", "build"])) | ||
|
||
This factory would then be attached to one builder (or several, if desired):: | ||
|
||
|
@@ -46,15 +45,13 @@ Using :meth:`addStep` is usually simpler, but there are cases where it is more c | |
|
||
:: | ||
|
||
from buildbot.steps import source, shell | ||
from buildbot.process import factory | ||
|
||
from buildbot.plugins import steps, util | ||
|
||
all_steps = [ | ||
source.CVS(cvsroot=CVSROOT, cvsmodule="project", mode="update"), | ||
shell.Compile(command=["make", "build"]), | ||
steps.CVS(cvsroot=CVSROOT, cvsmodule="project", mode="update"), | ||
steps.Compile(command=["make", "build"]), | ||
] | ||
f = factory.BuildFactory(all_steps) | ||
f = util.BuildFactory(all_steps) | ||
|
||
Finally, you can also add a sequence of steps all at once:: | ||
|
||
|
@@ -67,7 +64,7 @@ The following attributes can be set on a build factory after it is created, e.g. | |
|
||
:: | ||
|
||
f = factory.BuildFactory() | ||
f = util.BuildFactory() | ||
f.useProgress = False | ||
|
||
:attr:`useProgress` | ||
|
@@ -132,8 +129,8 @@ the default values will be suitable. | |
|
||
Example:: | ||
|
||
f = factory.GNUAutoconf(source=source.SVN(svnurl=URL, mode="copy"), | ||
flags=["--disable-nls"]) | ||
f = util.GNUAutoconf(source=source.SVN(svnurl=URL, mode="copy"), | ||
flags=["--disable-nls"]) | ||
|
||
Required Arguments: | ||
|
||
|
Oops, something went wrong.
The SVN step does not takes a svnurl parameter (repourl is better)