[Buildbot-devel] adding build steps on the fly
Aaron Maxwell
amax at redsymbol.net
Thu Jul 31 18:17:34 UTC 2008
On Thursday 31 July 2008 02:18:04 am Brian Gerkey wrote:
> hi,
>
> Is it possible to add a build step on the fly, during a build?
I faced this problem last year with 0.7.6. As far as I could tell, the set of
build steps for a factory instance is in effect immutable, unfortunately. I
was able to solved the problem anyway though. The solution I came up with
was to generate all possible factories at start up time. (In effect, all
possible sets of build steps). Then I would dynamically select the
appropriate factory depending on what kind of build was being run.
I accomplished this dynamism by subclassing
buildbot.process.factory.BuildFactory, and directing my set up to use this
subclass. I overrode BuildFactory.newBuild to set self.steps appropriately
before invoking the parent method. Also, it's important to set the class
attribute useProgress to False in your BuildFactory subclass - BB's progress
estimation algorithm assumes the sequence of steps is very static, with fatal
reactions if it changes. (At least in 0.7.6).
Perhaps someone knows of a better way to handle this. It's a lot of work, so
I'd recommend another approach if you can find one. In your situation, it
may be a possible to squeeze the set of new steps in a single build step,
containing a script that checks whether it needs to run, and prematurely
exits if not.
Another approach may be to have the step that processes a list of changed
files set a custom build property depending on the result, and having these
later steps only execute if this property is set to true (etc.)
Good luck
Aaron
>
> In particular, when a build is triggered, I want to process the list
> of changed files and potentially add new steps as a result of
> processing.
>
> I've tried a variety of things, such as writing my own class that
> inherits from a subclass of BuildStep, then mucking with
> self.build.steps in there, but so far to no avail.
>
> thanks,
> brian.
>
> -------------------------------------------------------------------------
> This SF.Net email is sponsored by the Moblin Your Move Developer's
> challenge Build the coolest Linux based applications with Moblin SDK & win
> great prizes Grand prize is a trip for two to an Open Source event anywhere
> in the world http://moblin-contest.org/redirect.php?banner_id=100&url=/
> _______________________________________________
> Buildbot-devel mailing list
> Buildbot-devel at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/buildbot-devel
--
Aaron Maxwell
http://redsymbol.net
More information about the devel
mailing list