mirror of
https://pagure.io/fm-orchestrator.git
synced 2026-02-12 01:24:59 +08:00
Fallback to koji when module is not in copr
This commit is contained in:
@@ -28,6 +28,7 @@ class BaseConfiguration(object):
|
||||
KOJI_PROFILE = 'koji'
|
||||
KOJI_ARCHES = ['i686', 'armv7hl', 'x86_64']
|
||||
KOJI_PROXYUSER = True
|
||||
KOJI_REPOSITORY_URL = 'https://kojipkgs.stg.fedoraproject.org/repos'
|
||||
COPR_CONFIG = '/etc/module_build_service/copr.conf'
|
||||
PDC_URL = 'http://modularity.fedorainfracloud.org:8080/rest_api/v1'
|
||||
PDC_INSECURE = True
|
||||
@@ -128,7 +129,6 @@ class TestConfiguration(BaseConfiguration):
|
||||
|
||||
KOJI_CONFIG = './conf/koji.conf'
|
||||
KOJI_PROFILE = 'staging'
|
||||
KOJI_REPOSITORY_URL = 'https://kojipkgs.stg.fedoraproject.org/repos'
|
||||
|
||||
|
||||
class ProdConfiguration(BaseConfiguration):
|
||||
|
||||
@@ -861,10 +861,17 @@ class CoprModuleBuilder(GenericBuilder):
|
||||
def buildroot_add_repos(self, dependencies):
|
||||
log.info("%r adding deps on %r" % (self, dependencies))
|
||||
# @TODO get architecture from some builder variable
|
||||
# @TODO use the proper backend for each dependency
|
||||
repos = [GenericBuilder.tag_to_repo("copr", self.config, d, "x86_64") for d in dependencies]
|
||||
repos = [self._dependency_repo(d, "x86_64") for d in dependencies]
|
||||
self.client.modify_project(self.copr.projectname, username=self.copr.username, repos=repos)
|
||||
|
||||
def _dependency_repo(self, module, arch, backend="copr"):
|
||||
try:
|
||||
repo = GenericBuilder.tag_to_repo(backend, self.config, module, arch)
|
||||
return repo
|
||||
except ValueError:
|
||||
if backend == "copr":
|
||||
return self._dependency_repo(module, arch, "koji")
|
||||
|
||||
def build(self, artifact_name, source):
|
||||
"""
|
||||
:param artifact_name : A package name. We can't guess it since macros
|
||||
@@ -1000,12 +1007,14 @@ class CoprModuleBuilder(GenericBuilder):
|
||||
# Premise is that tag_name is in name-stream-version format
|
||||
name, stream, version = tag_name.rsplit("-", 2)
|
||||
|
||||
client = cls._get_client(config)
|
||||
response = client.get_module_repo(owner, project, name, stream, version, arch).data
|
||||
from copr.exceptions import CoprRequestException
|
||||
try:
|
||||
client = cls._get_client(config)
|
||||
response = client.get_module_repo(owner, project, name, stream, version, arch).data
|
||||
return response["repo"]
|
||||
|
||||
if response["output"] == "notok":
|
||||
raise ValueError(response["error"])
|
||||
return response["repo"]
|
||||
except CoprRequestException as e:
|
||||
raise ValueError(e)
|
||||
|
||||
def cancel_build(self, task_id):
|
||||
pass
|
||||
|
||||
Reference in New Issue
Block a user