mirror of
https://pagure.io/fm-orchestrator.git
synced 2026-04-04 03:08:21 +08:00
Add NUM_CONSECUTIVE_BUILDS configuration option
This commit is contained in:
@@ -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/'
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user