Package buildbot :: Package steps :: Module shell :: Class ShellCommand
[frames] | no frames]

Class ShellCommand

source code

process.properties.PropertiesMixin --+        
                                     |        
           process.buildstep.BuildStep --+    
                                         |    
        process.buildstep.LoggingBuildStep --+
                                             |
                                            ShellCommand
Known Subclasses:

I run a single shell command on the buildslave. I return FAILURE if the exit code of that command is non-zero, SUCCESS otherwise. To change this behavior, override my .evaluateCommand method.

By default, a failure of this step will mark the whole build as FAILURE. To override this, give me an argument of flunkOnFailure=False .

I create a single Log named 'log' which contains the output of the command. To create additional summary Logs, override my .createSummary method.

The shell command I run (a list of argv strings) can be provided in several ways:

Instance Methods
 
__init__(self, workdir=None, description=None, descriptionDone=None, command=None, usePTY='slave-config', **kwargs) source code
 
setBuild(self, build) source code
 
setStepStatus(self, step_status) source code
 
setDefaultWorkdir(self, workdir) source code
 
getWorkdir(self)
Get the current notion of the workdir.
source code
 
setCommand(self, command) source code
 
describe(self, done=False)
Return a list of short strings to describe this step, for the status display.
source code
 
setupEnvironment(self, cmd) source code
 
buildCommandKwargs(self, warnings) source code
 
start(self) source code

Inherited from process.buildstep.LoggingBuildStep: addLogFile, checkDisconnect, commandComplete, createSummary, evaluateCommand, getText, getText2, interrupt, maybeGetText2, setStatus, setupLogfiles, startCommand

Inherited from process.buildstep.BuildStep: __provides__, acquireLocks, addCompleteLog, addFactoryArguments, addHTMLLog, addLog, addLogObserver, addURL, failed, finished, getLog, getSlaveName, getStepFactory, releaseLocks, runCommand, setBuildSlave, setProgress, setupProgress, slaveVersion, slaveVersionIsOlderThan, startStep

Inherited from process.properties.PropertiesMixin: __providedBy__, getProperties, getProperty, hasProperty, has_key, render, setProperty

Class Variables
  name = 'shell'
  renderables = ['description', 'descriptionDone', 'slaveEnviron...
  description = None
hash(x)
  descriptionDone = None
hash(x)
  flunkOnFailure = True

Inherited from process.buildstep.LoggingBuildStep: cmd, parms, progressMetrics

Inherited from process.buildstep.BuildStep: __implemented__, alwaysRun, build, doStepIf, flunkOnWarnings, haltOnFailure, hideStepIf, locks, progress, set_runtime_properties, step_status, useProgress, warnOnFailure, warnOnWarnings

Instance Variables
  command = None
a list of renderable objects (typically strings or WithProperties instances).
  lazylogfiles
Defaults to False.
  logfiles
a dict mapping log NAMEs to workdir-relative FILENAMEs of their corresponding logfiles.
Method Details

__init__(self, workdir=None, description=None, descriptionDone=None, command=None, usePTY='slave-config', **kwargs)
(Constructor)

source code 
Overrides: process.buildstep.BuildStep.__init__

setBuild(self, build)

source code 
Overrides: process.buildstep.BuildStep.setBuild

setStepStatus(self, step_status)

source code 
Overrides: process.buildstep.BuildStep.setStepStatus

setDefaultWorkdir(self, workdir)

source code 
Overrides: process.buildstep.BuildStep.setDefaultWorkdir

getWorkdir(self)

source code 

Get the current notion of the workdir. Note that this may change between instantiation of the step and start, as it is based on the build's default workdir, and may even be None before that point.

describe(self, done=False)

source code 

Return a list of short strings to describe this step, for the status display. This uses the first few words of the shell command. You can replace this by setting .description in your subclass, or by overriding this method to describe the step better.

Parameters:
  • done (boolean) - whether the command is complete or not, to improve the way the command is described. done=False is used while the command is still running, so a single imperfect-tense verb is appropriate ('compiling', 'testing', ...) done=True is used when the command has finished, and the default getText() method adds some text, so a simple noun is appropriate ('compile', 'tests' ...)
Overrides: process.buildstep.BuildStep.describe

buildCommandKwargs(self, warnings)

source code 
Overrides: process.buildstep.LoggingBuildStep.buildCommandKwargs

start(self)

source code 
Overrides: process.buildstep.BuildStep.start

Class Variable Details

renderables

Value:
['description',
 'descriptionDone',
 'slaveEnvironment',
 'remote_kwargs',
 'command',
 'logfiles']

Instance Variable Details

command

a list of renderable objects (typically strings or WithProperties instances). This will be used by start() to create a RemoteShellCommand instance.
Value:
None

lazylogfiles

Defaults to False. If True, logfiles will be tracked `lazily', meaning they will only be added when and if they are written to. Empty or nonexistent logfiles will be omitted. (Also handled by class LoggingBuildStep.)

logfiles

a dict mapping log NAMEs to workdir-relative FILENAMEs of their corresponding logfiles. The contents of the file named FILENAME will be put into a LogFile named NAME, ina something approximating real-time. (note that logfiles= is actually handled by our parent class LoggingBuildStep)