Question

I'm using buildbot as continuous integration tool. It's working perfectly to run commit builds and nightly builds on both Linux and Windows platforms.

For the commit builds (triggered at each commit) and for the nightly builds (every night, building from a clean repository checkout) I use two different builders. But in the end, they both run the same commands, apart from the source repository get step. Furthermore, in the http waterfall view, they occupy two columns, whereas one is used only at day time, and the other only once during the night.

I was wondering if it was possible to have a configuration with only one single builder that would perform both the nightly builds and the daily commit builds?

(It would add as a benefit to reset the commit builds every night!)


Edit: A solution

Following Tom Prince answer, I managed to setup all this using the 'doStepIf'. It requires to set a property in the nightly scheduler, and to use this property for the doStepIf of a RemoveDirectory step right before the SVN step.

commit = AnyBranchScheduler( name="commit", treeStableTimer=5*60,
                             builderNames=["builder"] )

nightly = Nightly( name='nightly', hour=23, minute=40,
                   properties={'full':True},
                   builderNames=["builder"] )

def IsFullBuild(step):
     return step.build.getProperties().has_key('full')
            and step.build.getProperty('full')

factory.addStep( RemoveDirectory( dir="build", doStepIf=IsFullBuild ) )
factory.addStep( SVN( ... ) )
Était-ce utile?

La solution

You could do this currently by setting a property in one of the schedulers, and using two steps, controlled by doStepIf, so only one runs.

Another option, which would require a minor change to buildbot, is to make the mode parameter renderable, which would allow you to use a property to control the mode used to update the repository.

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top