[users at bb.net] Limiting the number of builds per day

Pierre Tardy tardyp at gmail.com
Wed Apr 26 08:07:34 UTC 2017


On Tue, Apr 25, 2017 at 11:13 PM Mojca Miklavec <mojca at macports.org> wrote:

> Dear Pierre,
>
> On 17 April 2017 at 20:10, Pierre Tardy wrote:
> > Hi Mojca,
> > the Nightly scheduler has a onlyIfChanged argument which is exactly meant
> > for that.
> >
> > You need to setup properly a change source, and change filter, and then
> > trigger every now and then. the builder will only start if there are
> change
> > ongoing for it.
> >
> >
> http://docs.buildbot.net/latest/manual/cfg-schedulers.html#nightly-scheduler
>
> I tested it and it seems to work well, but some minor disadvantages:
>
> - If I manually trigger the build (let's say because there was a
> change and I want it built ASAP), the nightly scheduler will still
> trigger even if I have the latest source built.
>

AFAIK, There is no built in feature for that use case.
You would need a custom step of some sort, which would look at the last
build, and see if it has the same revision. In that case, the step would
cancel the build

After the git step, you would insert a step like this (untested, but I hope
this could show readers how simple it is to use new style steps)

class CancelIfAlreadyBuilt(BuildStep):
    @defer.inlineCallbacks
    def run(self):
        builderid = yield self.build.getBuilderId()
        build = yield self.master.data.get(('builders', builderid,
'builds', self.build.number - 1))
        props = yield self.master.data.get(('builds',
str(build['buildid']), "properties"))
        if props.get('got_revision', [None, None])[0] ==
self.getProperty('got_revision'):
            yield self.build.stopBuild()
        defer.returnValue(SUCCESS)


> - There is often some minor change in the README file for which I know
> that there won't be any difference in the final binary file. I didn't
> find any way to "skip the build for that day" (other than
> reconfiguring the build master).
>

There are the fileIsImportant and onlyImportant parameters of a scheduler
that is made exactly for that
http://docs.buildbot.net/latest/manual/cfg-schedulers.html#configuring-schedulers

>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.buildbot.net/pipermail/users/attachments/20170426/3dff18a5/attachment.html>


More information about the users mailing list