[Buildbot-devel] Running a buildstep only if previous steps completed successfully.

Aurelien Bompard aurelien at bompard.org
Wed Sep 8 21:06:57 UTC 2010


Hi Scott,

> I have a buildset which consists of several build steps. I'd like to run
> a final buildstep only if all of the previous steps completed
> successfully.

I've had a rather similar need, I had to check the state of the previous 
build step. I used a custom buid step class, with the following function:

    def getPreviousStepStatus(self):
        steps_status = self.build.build_status.getSteps()
        self_status_index = steps_status.index(self.step_status)
        if self_status_index == 0:
            return (None, 0)
        return steps_status[self_status_index - 1].results

By iterating on self.build.build_status.getSteps() and checking the 'result' 
attribute, you should be able to do you want. The tuple (None, 0) means 
there is no result available yet, it could be your break condition.

Cheers,
Aurélien
-- 
http://aurelien.bompard.org  ~~~~  Jabber : abompard at jabber.fr
"Unix was not designed to stop you from doing stupid things, because
that would also stop you from doing clever things." -- Doug Gwyn
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: This is a digitally signed message part.
URL: <http://buildbot.net/pipermail/devel/attachments/20100908/ff4ca516/attachment.bin>


More information about the devel mailing list