[Buildbot-devel] Not executing a step if the build is about to fail

Dustin J. Mitchell dustin at zmanda.com
Tue Jul 15 03:08:39 UTC 2008


On Mon, Jul 14, 2008 at 10:46 PM, Sergey A. Lipnevich
<sergey at optimaltec.com> wrote:
> I'd like "package" and "kick off more builds" steps not to run if
> anything in front of them in the chain fails (mostly, if "build" fails).
> At the same time, if "before" succeeds, "after" *must* run. In effect, I
> need a "don't run this step if build as a whole is guaranteed to fail"
> flag. What would be the best way to accomplish this?
> Thank you,

I don't have a good way to solve this in the current framework, but
this is a great example of a need for greater programmatic control
over the steps in a build.  This sort of question has led me to think
of builds as executing a long-running function:

def mybuild():
       if not prepare(): return False
       if not before(): return False
       success = build()
       success = after() and success
       if success:
         success = package() and success
       if success:
         for subbuild in [ .. ]:
           spawn(subbuild)
       return success

This example doesn't really require it, but you could use if/elses,
arbitrarily analyze the situation to determine if a particular step
needs to be run, use try/except/finally, etc.

Dream big :)
Dustin

-- 
Storage Software Engineer
http://www.zmanda.com




More information about the devel mailing list