mirror of
https://pagure.io/fm-orchestrator.git
synced 2026-04-04 19:28:49 +08:00
Add CoprModuleBuilder skeleton
This commit is contained in:
@@ -238,6 +238,9 @@ class Builder(object):
|
||||
if backend == "koji":
|
||||
return KojiModuleBuilder(owner=owner, module=module,
|
||||
config=config, **extra)
|
||||
elif backend == "copr":
|
||||
return CoprModuleBuilder(owner=owner, module=module,
|
||||
config=config, **extra)
|
||||
else:
|
||||
raise ValueError("Builder backend='%s' not recognized" % backend)
|
||||
|
||||
@@ -709,3 +712,36 @@ chmod 644 %buildroot/%_rpmconfigdir/macros.d/macros.modules
|
||||
raise SystemError("Target references unexpected dest_tag_name. Got '%s', expected '%s'. Please contact administrator." % (target_info['dest_tag_name'], dest_tag['name']))
|
||||
|
||||
return self.koji_session.getBuildTarget(name)
|
||||
|
||||
|
||||
class CoprModuleBuilder(GenericBuilder):
|
||||
|
||||
backend = "copr"
|
||||
|
||||
def __init__(self, module, config, tag_name):
|
||||
self.module_str = module
|
||||
self.tag_name = tag_name
|
||||
|
||||
def buildroot_prep(self):
|
||||
pass
|
||||
|
||||
def buildroot_resume(self):
|
||||
pass
|
||||
|
||||
def buildroot_ready(self, artifacts=None):
|
||||
return True
|
||||
|
||||
def buildroot_add_dependency(self, dependencies):
|
||||
pass
|
||||
|
||||
def buildroot_add_artifacts(self, artifacts, install=False):
|
||||
pass
|
||||
|
||||
def build(self, artifact_name, source):
|
||||
log.info("Copr build")
|
||||
pass
|
||||
|
||||
@staticmethod
|
||||
def get_disttag_srpm(disttag):
|
||||
# @FIXME
|
||||
return KojiModuleBuilder.get_disttag_srpm(disttag)
|
||||
|
||||
@@ -92,7 +92,7 @@ class Config(object):
|
||||
@system.setter
|
||||
def system(self, s):
|
||||
s = str(s)
|
||||
if s not in ("koji"):
|
||||
if s not in ("koji", "copr"):
|
||||
raise ValueError("Unsupported buildsystem.")
|
||||
self._system = s
|
||||
|
||||
|
||||
@@ -219,6 +219,10 @@ class Poller(threading.Thread):
|
||||
)
|
||||
self.outgoing_work_queue.put(msg)
|
||||
|
||||
elif conf.system == "copr":
|
||||
# @TODO
|
||||
pass
|
||||
|
||||
else:
|
||||
raise NotImplementedError("Buildsystem %r is not supported." % conf.system)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user