Skip to content

Commit

Permalink
Merge branch 'NightlySchedFixes' of git://github.com/garetharmstrongh…
Browse files Browse the repository at this point in the history
…p/buildbot

* 'NightlySchedFixes' of git://github.com/garetharmstronghp/buildbot:
  Fix Nightly Scheduler docstring - specify Scheduler arguments by name
  Don't fire Nightly scheduler when onlyIfChanged is set and no changes on branch

Signed-off-by: Dustin J. Mitchell <dustin@zmanda.com>
  • Loading branch information
Dustin J. Mitchell committed May 7, 2010
2 parents eeb57f2 + 30c3a64 commit cec2bf6
Showing 1 changed file with 14 additions and 5 deletions.
19 changes: 14 additions & 5 deletions buildbot/schedulers/timed.py
Expand Up @@ -130,22 +130,25 @@ class Nightly(base.BaseScheduler, base.ClassifierMixin, TimedBuildMixin):
For example, the following master.cfg clause will cause a build to be
started every night at 3:00am::
s = Nightly('nightly', ['builder1', 'builder2'], hour=3, minute=0)
s = Nightly(name='nightly', builderNames=['builder1', 'builder2'],
hour=3, minute=0)
c['schedules'].append(s)
This scheduler will perform a build each monday morning at 6:23am and
again at 8:23am::
s = Nightly('BeforeWork', ['builder1'],
s = Nightly(name='BeforeWork', builderNames=['builder1'],
dayOfWeek=0, hour=[6,8], minute=23)
The following runs a build every two hours::
s = Nightly('every2hours', ['builder1'], hour=range(0, 24, 2))
s = Nightly(name='every2hours', builderNames=['builder1'],
hour=range(0, 24, 2))
And this one will run only on December 24th::
s = Nightly('SleighPreflightCheck', ['flying_circuits', 'radar'],
s = Nightly(name='SleighPreflightCheck',
builderNames=['flying_circuits', 'radar'],
month=12, dayOfMonth=24, hour=12, minute=0)
For dayOfWeek and dayOfMonth, builds are triggered if the date matches
Expand All @@ -166,7 +169,8 @@ def isSourceFile(change):
if fn.endswith('.c') or fn.endswith('.h'):
return True
return False
s = Nightly('nightly-when-changed', ['builder1'], hour=3, minute=0,
s = Nightly(name='nightly-when-changed', builderNames=['builder1'],
hour=3, minute=0,
onlyIfChanged=True, fileIsImportant=isSourceFile)
onlyIfChanged defaults to False, which means a build will be performed
Expand Down Expand Up @@ -258,6 +262,11 @@ def _maybe_start_build(self, t):
return
relevant_changes = [c for c in (important + unimportant) if
c.branch == self.branch]
if not relevant_changes:
log.msg("Nightly Scheduler <%s>: "
"skipping build - No relevant change on branch" %
self.name)
return
self.start_requested_build(t, relevant_changes)
# retire the changes
changeids = [c.number for c in relevant_changes]
Expand Down

0 comments on commit cec2bf6

Please sign in to comment.