Package buildbot :: Package schedulers :: Module timed :: Class Nightly
[frames] | no frames]

Class Nightly

source code

 twisted.application.service.Service --+        
                                       |        
twisted.application.service.MultiService --+    
                                           |    
                    util.ComparableMixin --+    
                                           |    
                          base.BaseScheduler --+
                                               |
                        base.ClassifierMixin --+
                                               |
                             TimedBuildMixin --+
                                               |
                                              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(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(name='BeforeWork', builderNames=['builder1'],
             dayOfWeek=0, hour=[6,8], minute=23)

The following runs a build every two hours::

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

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

 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
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.

When onlyIfChanged is True, the build is triggered only if changes have
arrived on the given branch since the last build was performed. As a
further restriction, if fileIsImportant= is provided (a one-argument
callable which takes a Change object and returns a bool), then the build
will be triggered only if at least one of those changes qualifies as
'important'. The following example will run a build at 3am, but only when
a source code file (.c/.h) has been changed:

 def isSourceFile(change):
     for fn in change.files:
         if fn.endswith('.c') or fn.endswith('.h'):
             return True
     return False
 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
even if nothing has changed.

Instance Methods
 
__init__(self, name, builderNames, minute=0, hour='*', dayOfMonth='*', month='*', dayOfWeek='*', branch=None, fileIsImportant=None, onlyIfChanged=False, properties={}) source code
 
get_initial_state(self, max_changeid) source code
 
getPendingBuildTimes(self) source code
 
run(self) source code

Inherited from base.BaseScheduler: compareToOther, create_buildset, get_state, listBuilderNames, set_state

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

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

Inherited from util.ComparableMixin: __cmp__, __hash__

Inherited from base.ClassifierMixin: classify_changes, make_filter

Inherited from TimedBuildMixin: start_HEAD_build, start_requested_build, update_last_build

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

Inherited from base.BaseScheduler: __implemented__, __provides__, upstream_name

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

Method Details

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

source code 
Overrides: twisted.application.service.MultiService.__init__

get_initial_state(self, max_changeid)

source code 
Overrides: base.BaseScheduler.get_initial_state

getPendingBuildTimes(self)

source code 
Overrides: base.BaseScheduler.getPendingBuildTimes

Class Variable Details

compare_attrs

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