[users at bb.net] How to preface one ShellCommand with another?
Gabriel Nagy
gabrielnagy at me.com
Thu Jul 26 18:54:42 UTC 2018
Hi Greg,
First solutions that come to my mind are to maybe create a shell script for the whole command sequence (lazier) or, Buildbot supports setting environment variables for specific commands with env, like here: http://docs.buildbot.net/latest/manual/cfg-buildsteps.html#using-shellcommands
Hope this helps,
Gabe
On Jul 26, 2018, at 09:46 PM, Greg Bullock <greg at nwra.com> wrote:
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
_______________________________________________
users mailing list
users at buildbot.net
https://lists.buildbot.net/mailman/listinfo/users
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.buildbot.net/pipermail/users/attachments/20180726/5c2cc27e/attachment.html>
More information about the users
mailing list