[Buildbot-devel] Dynamic list of logfiles

Axel Hecht l10n.moz at googlemail.com
Mon Feb 16 22:53:22 UTC 2009

2009/2/16 Greg Ward
<gerg.ward+buildbot at gmail.com<gerg.ward%2Bbuildbot at gmail.com>

> Hi all --
> I have a ShellCommand that creates log files based on what it finds in
> its build tree.  Specifically, it's a wrapper around "rpmbuild" that
> processes <dir>/*.spec, creating one log for each .spec file
> processed.
> Currently, I have cobbled something together where I use a SetProperty
> step to look for the same list of *.spec files and derive the log
> filenames from that.  That's a bit gross because I'm repeating two
> bits of logic (find *.spec and transmute foo.spec to foo.log) in two
> places (the script being run and master.cfg).
> It has occurred to me that a ShellCommand that dynamically discovers
> log files would be really cool.  I think I want something like this:
>  ShellCommand(name="build-rpms",
>               command=["./buildrpms",
>                        "--spec-dir", "spec",
>                        "--log-dir", "log"],
>               logfilepattern="log/buildrpms.*.log")
> Then, as my buildrpms script is running, SlaveShellCommand (I think)
> would periodically look for files matching my logfilepattern and
> update the step's log files accordingly.
> Does this sound crazy?  Has anyone attempted this?  Is it possible
> to do entirely within master.cfg, or would I need to patch slave-side
> code?

I'm not sure if logfilepattern is really that much of a use case in general
that it'd be worth adding that in general.

Here's what you had to do in principle:

After the step finishes, find all logs, transfer them to the master,
addCompleteLog there, or do a addLog().... They would then magically show up
in the web interface, too.

I would think that you had to do this when the step is actually done, as
you'd otherwise had to not just transfer the files, but watch for changes,
and update the upstream content. In general, you probably can't ensure that
those files are only appended to, so you'd run into issues when not.

All in all nothing too scary, but yes, you would need to hack python code on
the slave, and make sure that all your slaves get your custom buildbot, or
your buildbot customization.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://buildbot.net/pipermail/devel/attachments/20090216/584ad510/attachment.html>

More information about the devel mailing list