Add NUM_CONSECUTIVE_BUILDS configuration option

This commit is contained in:
Matt Prahl
2016-11-10 13:36:47 -05:00
parent fb043cd2c7
commit 2cb7ce99c6
2 changed files with 15 additions and 0 deletions

View File

@@ -28,6 +28,10 @@ class BaseConfiguration(object):
# Set to zero to disable polling
POLLING_INTERVAL = 600
# Determines how many builds that can be submitted to the builder
# and be in the build state at a time. Set this to 0 for no restrictions
NUM_CONSECUTIVE_BUILDS = 5
RPMS_DEFAULT_REPOSITORY = 'git://pkgs.fedoraproject.org/rpms/'
RPMS_ALLOW_REPOSITORY = False
RPMS_DEFAULT_CACHE = 'http://pkgs.fedoraproject.org/repo/pkgs/'

View File

@@ -200,6 +200,10 @@ class Config(object):
'type': list,
'default': [],
'desc': 'Allowed SCM URLs.'},
'num_consecutive_builds': {
'type': int,
'default': 0,
'desc': 'Number of consecutive component builds.'},
}
def __init__(self):
@@ -301,3 +305,10 @@ class Config(object):
if not isinstance(l, list):
raise TypeError("scmurls needs to be a list.")
self.scmurls = [str(x) for x in l]
def _setifok_num_consecutive_builds(self, i):
if not isinstance(i, int):
raise TypeError('NUM_CONSECUTIVE_BUILDS needs to be an int')
if i < 0:
raise ValueError('NUM_CONSECUTIVE_BUILDS must be >= 0')
self.num_consecutive_builds = i