<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body text="#000000" bgcolor="#FFFFFF">
<p>Thank you for the fine suggestions, Gabe. <br>
</p>
<p>The shell script suggestion should work just fine for me.</p>
<p>-Greg<br>
</p>
<br>
<div class="moz-cite-prefix">On 7/26/2018 11:54 AM, Gabriel Nagy
wrote:<br>
</div>
<blockquote type="cite"
cite="mid:28c15894-afe1-468f-b2f7-a676cb0a242b@me.com">
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<div>Hi Greg,</div>
<div><br data-mce-bogus="1">
</div>
<div>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: <a
href="http://docs.buildbot.net/latest/manual/cfg-buildsteps.html#using-shellcommands"
moz-do-not-send="true">http://docs.buildbot.net/latest/manual/cfg-buildsteps.html#using-shellcommands</a></div>
<div><br data-mce-bogus="1">
</div>
<div>Hope this helps,</div>
<div>Gabe</div>
<div><br>
On Jul 26, 2018, at 09:46 PM, Greg Bullock <a class="moz-txt-link-rfc2396E" href="mailto:greg@nwra.com"><greg@nwra.com></a>
wrote:<br>
<br>
</div>
<div>
<blockquote type="cite">
<div class="msg-quote" text="#000000" bgcolor="#FFFFFF">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?<br>
<br>
I'd like a Step or set of Steps to perform the following
sequence of commands on our Linux-based builders:
<p><span face="Courier New, Courier, monospace"
data-mce-style="font-family: 'Courier New', Courier,
monospace;" style="font-family: 'Courier New', Courier,
monospace;">module load intel</span></p>
<p><span face="Courier New, Courier, monospace"
data-mce-style="font-family: 'Courier New', Courier,
monospace;" style="font-family: 'Courier New', Courier,
monospace;">cmake -DCMAKE_Fortran_COMPILER=ifort ../</span><span
face="Courier New, Courier, monospace"
data-mce-style="font-family: 'Courier New', Courier,
monospace;" style="font-family: 'Courier New', Courier,
monospace;"><span face="Courier New, Courier, monospace"
data-mce-style="font-family: 'Courier New', Courier,
monospace;" style="font-family: 'Courier New',
Courier, monospace;">prj</span>/my_project</span></p>
<p><span face="Courier New, Courier, monospace"
data-mce-style="font-family: 'Courier New', Courier,
monospace;" style="font-family: 'Courier New', Courier,
monospace;">make all</span></p>
<p>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.</p>
<p>The step needs have haltOnFailure=False for the first
command, but haltOnFailure=True for the two subsequent
commands.</p>
<p>The option to use <br>
</p>
<p><span face="Courier New, Courier, monospace"
data-mce-style="font-family: 'Courier New', Courier,
monospace;" style="font-family: 'Courier New', Courier,
monospace;">steps.ShellCommand(</span></p>
<p><span face="Courier New, Courier, monospace"
data-mce-style="font-family: 'Courier New', Courier,
monospace;" style="font-family: 'Courier New', Courier,
monospace;"> command=['module', 'load', 'intel',</span></p>
<p><span face="Courier New, Courier, monospace"
data-mce-style="font-family: 'Courier New', Courier,
monospace;" style="font-family: 'Courier New', Courier,
monospace;"> ';',</span></p>
<p><span face="Courier New, Courier, monospace"
data-mce-style="font-family: 'Courier New', Courier,
monospace;" style="font-family: 'Courier New', Courier,
monospace;"> 'cmake',
'-DCMAKE_Fortran_COMPILER=ifort', '../prj/my_project'],</span></p>
<p><span face="Courier New, Courier, monospace"
data-mce-style="font-family: 'Courier New', Courier,
monospace;" style="font-family: 'Courier New', Courier,
monospace;"> haltOnFailure=True)</span></p>
<p>and <br>
</p>
<p><span face="Courier New, Courier, monospace"
data-mce-style="font-family: 'Courier New', Courier,
monospace;" style="font-family: 'Courier New', Courier,
monospace;">steps.ShellCommand(</span></p>
<p><span face="Courier New, Courier, monospace"
data-mce-style="font-family: 'Courier New', Courier,
monospace;" style="font-family: 'Courier New', Courier,
monospace;"> command=['module', 'load', 'intel',</span></p>
<p><span face="Courier New, Courier, monospace"
data-mce-style="font-family: 'Courier New', Courier,
monospace;" style="font-family: 'Courier New', Courier,
monospace;"> ';',</span></p>
<p><span face="Courier New, Courier, monospace"
data-mce-style="font-family: 'Courier New', Courier,
monospace;" style="font-family: 'Courier New', Courier,
monospace;"> 'make', 'all'],</span></p>
<p><span face="Courier New, Courier, monospace"
data-mce-style="font-family: 'Courier New', Courier,
monospace;" style="font-family: 'Courier New', Courier,
monospace;"> haltOnFailure=True)</span></p>
<p><span face="Courier New, Courier, monospace"
data-mce-style="font-family: 'Courier New', Courier,
monospace;" style="font-family: 'Courier New', Courier,
monospace;"><span face="Courier New, Courier, monospace"
data-mce-style="font-family: 'Courier New', Courier,
monospace;" style="font-family: 'Courier New',
Courier, monospace;"><br>
</span> </span></p>
<p>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.</p>
<p>Another option, to use</p>
<p><span face="Courier New, Courier, monospace"
data-mce-style="font-family: 'Courier New', Courier,
monospace;" style="font-family: 'Courier New', Courier,
monospace;">steps.ShellSequence(commands = [</span></p>
<p><span face="Courier New, Courier, monospace"
data-mce-style="font-family: 'Courier New', Courier,
monospace;" style="font-family: 'Courier New', Courier,
monospace;"> util.ShellArg(command = ['module',
'load', 'intel'], haltOnFailure=False),</span></p>
<p><span face="Courier New, Courier, monospace"
data-mce-style="font-family: 'Courier New', Courier,
monospace;" style="font-family: 'Courier New', Courier,
monospace;"> util.ShellArg(command = ['cmake',
'-DCMAKE_Fortran_COMPILER=ifort', '../prj/my_project'],
haltOnFailure=True),</span></p>
<p><span face="Courier New, Courier, monospace"
data-mce-style="font-family: 'Courier New', Courier,
monospace;" style="font-family: 'Courier New', Courier,
monospace;"> util.ShellArg(command = ['make', 'all'],
haltOnFailure=True),</span></p>
<p><span face="Courier New, Courier, monospace"
data-mce-style="font-family: 'Courier New', Courier,
monospace;" style="font-family: 'Courier New', Courier,
monospace;"> ])</span><br>
</p>
<p>has the problem that the preparation of the shell
environment by the first <span face="Courier New,
Courier, monospace" data-mce-style="font-family:
'Courier New', Courier, monospace;" style="font-family:
'Courier New', Courier, monospace;">ShellArg</span> does
not apply to the next two <span face="Courier New,
Courier, monospace" data-mce-style="font-family:
'Courier New', Courier, monospace;" style="font-family:
'Courier New', Courier, monospace;">ShellArg</span>s.<br>
</p>
<p>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?</p>
<p>If there were a way to set the Builder so the '<span
face="Courier New, Courier, monospace"
data-mce-style="font-family: 'Courier New', Courier,
monospace;" style="font-family: 'Courier New', Courier,
monospace;">module load intel</span>' command
automatically applies to all its build steps, that would
suffice for my purposes. <br>
</p>
<p><br>
</p>
<pre class="moz-signature">--
Greg Bullock
NorthWest Research Associates
301 Webster St.
Monterey, CA 93940
(831) 582-4907
<a class="moz-txt-link-abbreviated" href="mailto:greg@nwra.com" data-mce-href="mailto:greg@nwra.com" moz-do-not-send="true">greg@nwra.com</a>
</pre>
<div class="_stretch"><span class="body-text-content">_______________________________________________<br>
users mailing list<br>
<a href="mailto:users@buildbot.net"
data-mce-href="mailto:users@buildbot.net"
moz-do-not-send="true">users@buildbot.net</a><br>
<a
href="https://lists.buildbot.net/mailman/listinfo/users"
data-mce-href="https://lists.buildbot.net/mailman/listinfo/users"
moz-do-not-send="true">https://lists.buildbot.net/mailman/listinfo/users</a></span></div>
</div>
</blockquote>
</div>
</blockquote>
<br>
<pre class="moz-signature" cols="72">--
Greg Bullock
NorthWest Research Associates
301 Webster St.
Monterey, CA 93940
(831) 582-4907
<a class="moz-txt-link-abbreviated" href="mailto:greg@nwra.com">greg@nwra.com</a>
</pre>
</body>
</html>