[Buildbot-devel] observe the output of a command and set result
Kevin Funk
kevin.funk at kdab.com
Thu Dec 12 20:57:26 UTC 2013
Am Donnerstag, 12. Dezember 2013, 15:27:39 schrieb Jeremy Cornett:
> You need to write a script (language of your choice – python is my preferred
> since it’s already on the buildslave) that the build step will execute.
> That script should run the command “uname –a”, capture the output from that
> command, and then exit with a 0 (SUCCESS) if “blup” was present in the
> output, or exit with a 1 (FAILURE) if “blup” was present.
> Thanks,
> Jeremy
>
> From: nachaat hassis [mailto:nachaat05 at yahoo.fr]
> Sent: Thursday, December 12, 2013 1:14 AM
> To: buildbot-devel at lists.sourceforge.net
> Subject: [Buildbot-devel] observe the output of a command and set result
>
> Hello,
> im fighting since a few days with the buildbot and i have a small problem:
> I would like to execute a command "uname -a" and if the output
> (stdout/stdio) of the command contains "blup" the step will be marked as a
> SUCCESS, if the output doesnt contain the str "blup", the buildstep would
> be marked as FAILURE.
i can imagine its easy to do this, but i just cant
> find any example to do this. I would be really thankful if someone can give
> ma an example to do this.
> Best regards.
Hey,
I already posted this on #buildbot, but this is probably what you need:
http://docs.buildbot.net/latest/manual/customization.html#adding-logobservers
Just inherit from LogLineObserver, implement LogLineObserver.outLineReceived
as you need and then call BuildStep.addLogObserver on your step. That's
exactly what you're looking for, I think.
Greets
--
Kevin Funk
More information about the devel
mailing list