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

Class ShellCommand

source code

                            object --+        
                                     |        
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, or customize decodeRC argument

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, descriptionSuffix=None, command=None, usePTY='slave-config', **kwargs)
x.__init__(...) initializes x; see help(type(x)) for signature
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) 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, releaseLocks, runCommand, setBuildSlave, setProgress, setupProgress, slaveVersion, slaveVersionIsOlderThan, startStep

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

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

Static Methods

Inherited from process.buildstep.BuildStep: __new__

Class Variables
  name = 'shell'
  renderables = ['logfiles', 'lazylogfiles', 'slaveEnvironment',...
  description = None
hash(x)
  descriptionDone = None
hash(x)
  descriptionSuffix = 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.
Properties

Inherited from object: __class__

Method Details

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

source code 

x.__init__(...) initializes x; see help(type(x)) for signature

Overrides: object.__init__
(inherited documentation)

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 
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:
['logfiles',
 'lazylogfiles',
 'slaveEnvironment',
 'remote_kwargs',
 'command',
 'description',
 'descriptionDone',
 'descriptionSuffix']

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)