[Buildbot-devel] Property for current build status

Hugh Sorby h.sorby at auckland.ac.nz
Tue Dec 16 21:57:26 UTC 2014


I'm am trying to acheive the same thing myself at the moment,  I thought 
I would share my solution with you.

I am using the doStepIf argument to add a property that I can pass to my 
command, using your example:

def setBuildStatus(step):
     allSteps = step.build.getStatus().getSteps()
     lastStep = allSteps[0]
     (result, strings) = lastStep.getResults()
     step.setProperty('buildstatus', result, 'ShellCommand')
     return True

f.addStep(
     ShellCommand(
         name='record-build-end',
         doStepIf=setBuildStatus
         description='recording',
         descriptionDone='record',
         command=['bin/record-build-end', 
Interpolate("--status=%(prop:buildstatus)s")],
     )
)


Not pretty and I wouldn't mind seeing a better solution.

Cheers,
Hugh


On 12/17/14 09:56, Aran Deltac wrote:
> I'd like to add a build step to the end of my build which detects the 
> status (failed, successful) of the build so far.  This would then be 
> used as an argument to a script which would take action as 
> appropriate.  Something like:
>
> f.addStep(
>     ShellCommand(
>         name='record-build-end',
>         description='recording',
>         descriptionDone='record',
>         command=['bin/record-build-end', 
> Interpolate("--status=%(prop:buildstatus)s")],
>     )
> )
>
> I've looked around the docs, especially:
> http://docs.buildbot.net/0.8.9/manual/cfg-properties.html
>
> And no luck.  Thoughts?
>
> Thanks!
>
> Aran
>
>
> ------------------------------------------------------------------------------
> Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server
> from Actuate! Instantly Supercharge Your Business Reports and Dashboards
> with Interactivity, Sharing, Native Excel Exports, App Integration & more
> Get technology previously reserved for billion-dollar corporations, FREE
> http://pubads.g.doubleclick.net/gampad/clk?id=164703151&iu=/4140/ostg.clktrk
>
>
> _______________________________________________
> Buildbot-devel mailing list
> Buildbot-devel at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/buildbot-devel

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://buildbot.net/pipermail/devel/attachments/20141217/2e78d049/attachment.html>


More information about the devel mailing list