[Buildbot-devel] example of ShellCommands

Brian Warner warner at lothar.com
Sun Jan 11 06:18:03 UTC 2004


> I tried without success to get a ConfigurableBuildFactory with a 
> ShellCommands working. I could figure out from the examples how to do a 
> Compile step, but the ShellCommands one fails. What would be the right 
> way to go about it?
> 
> What I'm trying is:
> f1 = ConfigurableBuildFactory(
>         [
>         ( ShellCommands, { 'command' : 'echo foo' } )
>         ] )


ShellCommands takes an argument 'commands', which is a list. Each element of
the list is either a simple string, or a small dictionary. The dictionary
form lets you specify a separate working directory for each command, and
whether the command is "critical": i.e. if that command fails, should the
entire Step be abandoned?

So to do a single command in a ShellCommands (the degenerate case), you'd do:

f1 = ConfigurableBuildFactory(
        [
        ( ShellCommands, { 'commands' : ['echo foo'] } )
        ] )

To do multiple commands:

f1 = ConfigurableBuildFactory(
        [
        ( ShellCommands, { 'commands' : ['echo foo', 'echo bar'] } )
        ] )


ShellCommands is intended for use in places where the multiple shell commands
are logically all part of the same Step, like a "CVS Checkout" step that is
really a 'rm -rf tree; cvs checkout tree'. Doing it as a
ShellCommands(["foo", "bar"]) instead of a ShellCommand("foo; bar") felt a
little bit cleaner (shell syntax is yucky).

The docstring for ShellCommands has slightly more information.

 -Brian




More information about the devel mailing list