[Buildbot-devel] running a command if another fails?
Thomas Vander Stichele
thomas at apestaart.org
Sun May 1 22:24:07 UTC 2005
Hi,
> What's the best way to do this? I thought of running "make check ||
> cat testsuite.log", but is there a better way?
It probably is the better (read: easiest) way. I don't particularly
like it either, but it's a lot less code.
Having said that, I use some steps that do something similar to what you
want. First step is an incremental make, which just runs make. The
second step is a step that only runs if the first one fails, and runs
autogen in that case. Third one is another make, and only runs if the
first one failed.
This is done by having the "conditional" steps peek one or more steps up
for the results. So this only works if the conditional step can rely on
the step it's looking for to be exactly there (ie, inserting a step
later on will screw up your build).
here is the autogen one:
class AutogenAfterIncMake(Autogen):
def start(self, errorMessage=None):
previousResult = self.build.results[-1]
# if the inc make succeeded, we don't need to autogen
if previousResult == SUCCESS:
return SKIPPED
# otherwise, do what we would normally do
return step.ShellCommand.start(self, errorMessage)
Hope that helps,
Thomas
Dave/Dina : future TV today ! - http://www.davedina.org/
<-*- thomas (dot) apestaart (dot) org -*->
I'd like to tell you how I feel
I'll probably keep it till a Saturday
<-*- thomas (at) apestaart (dot) org -*->
URGent, best radio on the net - 24/7 ! - http://urgent.fm/
More information about the devel
mailing list