Package buildbot :: Module scheduler :: Class Nightly
[frames] | no frames]

Class Nightly

source code

 twisted.application.service.Service --+            
                                       |            
twisted.application.service.MultiService --+        
                                           |        
                    util.ComparableMixin --+        
                                           |        
                               BaseScheduler --+    
                                               |    
                           BaseUpstreamScheduler --+
                                                   |
                                                  Nightly

Imitate 'cron' scheduling. This can be used to schedule a nightly
build, or one which runs are certain times of the day, week, or month.

Pass some subset of minute, hour, dayOfMonth, month, and dayOfWeek; each
may be a single number or a list of valid values. The builds will be
triggered whenever the current time matches these values. Wildcards are
represented by a '*' string. All fields default to a wildcard except
'minute', so with no fields this defaults to a build every hour, on the
hour.

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)
 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'],
             dayOfWeek=0, hour=[6,8], minute=23)

The following runs a build every two hours::

 s = Nightly('every2hours', ['builder1'], hour=range(0, 24, 2))

And this one will run only on December 24th::

 s = Nightly('SleighPreflightCheck', ['flying_circuits', 'radar'],
             month=12, dayOfMonth=24, hour=12, minute=0)

For dayOfWeek and dayOfMonth, builds are triggered if the date matches
either of them. All time values are compared against the tuple returned
by time.localtime(), so month and dayOfMonth numbers start at 1, not
zero. dayOfWeek=0 is Monday, dayOfWeek=6 is Sunday.

onlyIfChanged functionality
s = Nightly('nightly', ['builder1', 'builder2'],
            hour=3, minute=0, onlyIfChanged=True)
When the flag is True (False by default), the build is trigged if
the date matches and if the branch has changed

fileIsImportant parameter is implemented as defined in class Scheduler

Instance Methods
 
__init__(self, name, builderNames, minute=0, hour='*', dayOfMonth='*', month='*', dayOfWeek='*', branch=None, fileIsImportant=None, onlyIfChanged=False, properties={}) source code
 
addTime(self, timetuple, secs) source code
 
findFirstValueAtLeast(self, values, value, default=None) source code
 
setTimer(self) source code
 
startService(self) source code
 
stopService(self) source code
 
isRunTime(self, timetuple) source code
 
calculateNextRunTime(self) source code
 
calculateNextRunTimeFrom(self, now) source code
 
listBuilderNames(self) source code
 
getPendingBuildTimes(self) source code
 
doPeriodicBuild(self) source code
 
addChange(self, change) source code
 
addImportantChange(self, change) source code
 
addUnimportantChange(self, change) source code

Inherited from BaseUpstreamScheduler: buildSetFinished, submitBuildSet, subscribeToSuccessfulBuilds, unsubscribeToSuccessfulBuilds

Inherited from BaseScheduler: __repr__

Inherited from twisted.application.service.MultiService: __iter__, addService, getServiceNamed, privilegedStartService, removeService

Inherited from twisted.application.service.Service: __getstate__, __providedBy__, disownServiceParent, setName, setServiceParent

Inherited from util.ComparableMixin: __cmp__, __hash__

Class Variables
  compare_attrs = ('name', 'builderNames', 'minute', 'hour', 'da...

Inherited from BaseUpstreamScheduler: __implemented__, __provides__

Inherited from twisted.application.service.Service: parent, running

Instance Variables

Inherited from BaseScheduler: name, properties

Method Details

__init__(self, name, builderNames, minute=0, hour='*', dayOfMonth='*', month='*', dayOfWeek='*', branch=None, fileIsImportant=None, onlyIfChanged=False, properties={})
(Constructor)

source code 
Parameters:
  • name - name for this scheduler
  • properties - properties to be propagated from this scheduler
Overrides: twisted.application.service.MultiService.__init__

startService(self)

source code 
Overrides: twisted.application.service.Service.startService

stopService(self)

source code 
Overrides: twisted.application.service.Service.stopService

addChange(self, change)

source code 
Overrides: BaseScheduler.addChange

Class Variable Details

compare_attrs

Value:
('name',
 'builderNames',
 'minute',
 'hour',
 'dayOfMonth',
 'month',
 'dayOfWeek',
 'branch',
...