[Buildbot-devel] Conditionally skipping build steps on codebase

Bruce Stephens bruce.stephens at isode.com
Sun Nov 25 16:10:12 UTC 2012


Bruce Stephens <bruce.stephens at isode.com> writes:

[...]

> Success, thanks!
>
> The doStepIf function is passed step, and step.build.requests has a list
> of requests (I forget the class), for each request, request.sources is a
> dict of SourceStamp objects (indexed by codebase), and in each, changes
> is a list of changes.
>
> So for the first request and for a codebase called 'one', checking
> whether this list is empty or not tells you whether it affects the given
> codebase:
>
>   step.build.requests[0].sources['one'].changes

An alternative route is to change Git (or subclass it, or whatever) and
set a source property when it's called and nothing has changed.

In fact I wanted to make further changes (to use a script we use instead
of using git clone), and (less trivially) to ignore local uncommitted
changes (some of our codebases change committed files during the build,
and I wanted to skip those).

[...]





More information about the devel mailing list