[users at bb.net] How to preface one ShellCommand with another?

Greg Bullock greg at nwra.com
Thu Jul 26 18:46:43 UTC 2018


I'm using Buildbot version: 1.3.0.  Is there a way to perform a specific 
ShellCommand as a preface for the shell of a subsequent ShellCommand or 
for multiple, subsequent ShellCommands?

I'd like a Step or set of Steps to perform the following sequence of 
commands on our Linux-based builders:

module load intel

cmake -DCMAKE_Fortran_COMPILER=ifort ../prj/my_project

make all

The first command here prepares the environment (PATH and 
LD_LIBRARY_PATH) and possibly makes some other changes to select the 
desired version of, and acquire the floating license for, the compiler 
used by the two subsequent commands.

The step needs have haltOnFailure=False for the first command, but 
haltOnFailure=True for the two subsequent commands.

The option to use

steps.ShellCommand(

     command=['module', 'load', 'intel',

         ';',

         'cmake', '-DCMAKE_Fortran_COMPILER=ifort', '../prj/my_project'],

haltOnFailure=True)

and

steps.ShellCommand(

command=['module', 'load', 'intel',

         ';',

         'make', 'all'],

haltOnFailure=True)


has the problem that the haltOnFailure=True applies to the first command 
(module load intel) as well as the subsequent command, which is not desired.

Another option, to use

steps.ShellSequence(commands = [

util.ShellArg(command = ['module', 'load', 'intel'], haltOnFailure=False),

util.ShellArg(command = ['cmake', '-DCMAKE_Fortran_COMPILER=ifort', 
'../prj/my_project'], haltOnFailure=True),

util.ShellArg(command = ['make', 'all'], haltOnFailure=True),

     ])

has the problem that the preparation of the shell environment by the 
first ShellArg does not apply to the next two ShellArgs.

Is there some adjust to either of these options to get what I need?  Or 
is there some other way to get what I need?

If there were a way to set the Builder so the 'module load intel' 
command automatically applies to all its build steps, that would suffice 
for my purposes.


-- 
Greg Bullock
NorthWest Research Associates
301 Webster St.
Monterey, CA  93940
(831) 582-4907
greg at nwra.com

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.buildbot.net/pipermail/users/attachments/20180726/c41e82ac/attachment.html>


More information about the users mailing list