<html lang="en"> <head> <title>Change Hooks - BuildBot Manual - 0.8.4p1</title> <meta http-equiv="Content-Type" content="text/html"> <meta name="description" content="BuildBot Manual - 0.8.4p1"> <meta name="generator" content="makeinfo 4.13"> <link title="Top" rel="start" href="index.html#Top"> <link rel="up" href="WebStatus.html#WebStatus" title="WebStatus"> <link rel="prev" href="WebStatus-Configuration-Parameters.html#WebStatus-Configuration-Parameters" title="WebStatus Configuration Parameters"> <link href="http://www.gnu.org/software/texinfo/" rel="generator-home" title="Texinfo Homepage"> <!-- This is the BuildBot manual for Buildbot version 0.8.4p1. Copyright (C) 2005, 2006, 2009, 2010 Brian Warner Copying and distribution of this file, with or without modification, are permitted in any medium without royalty provided the copyright notice and this notice are preserved.--> <meta http-equiv="Content-Style-Type" content="text/css"> <style type="text/css"><!-- pre.display { font-family:inherit } pre.format { font-family:inherit } pre.smalldisplay { font-family:inherit; font-size:smaller } pre.smallformat { font-family:inherit; font-size:smaller } pre.smallexample { font-size:smaller } pre.smalllisp { font-size:smaller } span.sc { font-variant:small-caps } span.roman { font-family:serif; font-weight:normal; } span.sansserif { font-family:sans-serif; font-weight:normal; } --></style> </head> <body> <div class="node"> <a name="Change-Hooks"></a> <p> Previous: <a rel="previous" accesskey="p" href="WebStatus-Configuration-Parameters.html#WebStatus-Configuration-Parameters">WebStatus Configuration Parameters</a>, Up: <a rel="up" accesskey="u" href="WebStatus.html#WebStatus">WebStatus</a> <hr> </div> <h5 class="subsubsection">4.14.1.3 Change Hooks</h5> <p>The /change_hook url is a magic URL which will accept HTTP requests and translate them into changes for buildbot. Implementations (such as a trivial json-based endpoint and a github implementation) can be found in <code>master/buildbot/status/web/hooks</code>. The format of the url is /change_hook/DIALECT where DIALECT is a package within the hooks directory. Change_hook is disabled by default and each DIALECT has to be enabled separately, for security reasons <p>An example WebStatus configuration line which enables change_hook and two DIALECTS: <pre class="example"> c['status'].append(html.WebStatus(http_port=8010,allowForce=True, change_hook_dialects={ 'base': True, 'somehook': {'option1':True, 'option2':False}})) </pre> <p>Within the WebStatus arguments, the <code>change_hook</code> key enables/disables the module and <code>change_hook_dialects</code> whitelists DIALECTs where the keys are the module names and the values are optional arguments which will be passed to the hooks. <p>The <samp><span class="file">post_build_request.py</span></samp> script in <samp><span class="file">master/contrib</span></samp> allows for the submission of an arbitrary change request. Run <code>post_build_request.py --help</code> for more information. The 'base' dialect must be enabled for this to work. <h3 class="heading">github hook</h3> <p>The github hook is simple and takes no options. <pre class="example"> c['status'].append(html.WebStatus(.. change_hook_dialects={ 'github' : True })) </pre> <p>With this set up, add a Post-Receive URL for the project in the Github administrative interface, pointing to <code>/change_hook/github</code> relative to the root of the web status. For example, if the grid URL is <code>http://builds.mycompany.com/bbot/grid</code>, then point Github to <code>http://builds.mycompany.com/bbot/change_hook/github</code>. To specify a project assoicated to the repository, append <code>?project=name</code> to the URL. <p>Note that there is a standalone HTTP server available for receiving github notifications, as well: <code>contrib/github_buildbot.py</code>. This script may be useful in cases where you cannot expose the WebStatus for public consumption. </body></html>