Sophie

Sophie

distrib > Fedora > 16 > i386 > by-pkgid > 9457b02689c69e152aa2cda68176fa51 > files > 158

buildbot-doc-0.8.4p1-2.fc16.noarch.rpm

<html lang="en">
<head>
<title>Running Commands on the Master - 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="Build-Steps.html#Build-Steps" title="Build Steps">
<link rel="prev" href="Transferring-Strings.html#Transferring-Strings" title="Transferring Strings">
<link rel="next" href="Setting-Properties.html#Setting-Properties" title="Setting Properties">
<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="Running-Commands-on-the-Master"></a>
<p>
Next:&nbsp;<a rel="next" accesskey="n" href="Setting-Properties.html#Setting-Properties">Setting Properties</a>,
Previous:&nbsp;<a rel="previous" accesskey="p" href="Transferring-Strings.html#Transferring-Strings">Transferring Strings</a>,
Up:&nbsp;<a rel="up" accesskey="u" href="Build-Steps.html#Build-Steps">Build Steps</a>
<hr>
</div>

<h4 class="subsection">4.12.9 Running Commands on the Master</h4>

<p><a name="index-buildbot_002esteps_002emaster_002eMasterShellCommand-129"></a>
Occasionally, it is useful to execute some task on the master, for example to
create a directory, deploy a build result, or trigger some other centralized
processing.  This is possible, in a limited fashion, with the
<code>MasterShellCommand</code> step.

   <p>This step operates similarly to a regular <code>ShellCommand</code>, but executes on
the master, instead of the slave.  To be clear, the enclosing <code>Build</code>
object must still have a slave object, just as for any other step &ndash; only, in
this step, the slave does not do anything.

   <p>In this example, the step renames a tarball based on the day of the week.

<pre class="example">     from buildbot.steps.transfer import FileUpload
     from buildbot.steps.master import MasterShellCommand
     
     f.addStep(FileUpload(slavesrc="widgetsoft.tar.gz",
                          masterdest="/var/buildoutputs/widgetsoft-new.tar.gz"))
     f.addStep(MasterShellCommand(command="""
         cd /var/buildoutputs;
         mv widgetsoft-new.tar.gz widgetsoft-`date +%a`.tar.gz"""))
</pre>
   <p>Note that, by default, this step passes a copy of the buildmaster's environment
variables to the subprocess.  To pass an explicit environment instead, add an
<code>env={..}</code> argument.

   </body></html>