mirror of
https://pagure.io/fm-orchestrator.git
synced 2026-04-04 19:28:49 +08:00
Enable koji content generator code
If the koji_enable_content_generator is configured to True koji instance has to be configured as follows: koji call addBType module koji grant-cg-access <mbs-user> module-build-service --new Without the above configuration MBS will start failing the builds
This commit is contained in:
@@ -32,6 +32,7 @@ class BaseConfiguration(object):
|
||||
KOJI_PROXYUSER = True
|
||||
KOJI_REPOSITORY_URL = 'https://kojipkgs.fedoraproject.org/repos'
|
||||
KOJI_TAG_PREFIXES = ['module']
|
||||
KOJI_ENABLE_CONTENT_GENERATOR = True
|
||||
COPR_CONFIG = '/etc/module-build-service/copr.conf'
|
||||
PDC_URL = 'http://pdc.fedoraproject.org/rest_api/v1'
|
||||
PDC_INSECURE = True
|
||||
|
||||
@@ -186,6 +186,11 @@ class Config(object):
|
||||
'default': 24*3600,
|
||||
'desc': 'Time in seconds after which the Koji target of '
|
||||
'built module is deleted'},
|
||||
'koji_enable_content_generator': {
|
||||
'type': bool,
|
||||
'default': True,
|
||||
'desc': 'Enable or disable imports to koji using content '
|
||||
'generator api'},
|
||||
'allow_custom_scmurls': {
|
||||
'type': bool,
|
||||
'default': False,
|
||||
|
||||
@@ -30,6 +30,7 @@ import module_build_service.utils
|
||||
import module_build_service.messaging
|
||||
from module_build_service.utils import (
|
||||
start_next_batch_build, attempt_to_reuse_all_components)
|
||||
from module_build_service.builder.KojiContentGenerator import KojiContentGenerator
|
||||
|
||||
from requests.exceptions import ConnectionError
|
||||
|
||||
@@ -120,6 +121,11 @@ def done(config, session, msg):
|
||||
# This is ok.. it's a race condition we can ignore.
|
||||
pass
|
||||
|
||||
if config.system == 'koji' and config.koji_enable_content_generator:
|
||||
# KojiContentGenerator import
|
||||
cg = KojiContentGenerator(build, config)
|
||||
cg.koji_import()
|
||||
|
||||
build.transition(config, state="ready")
|
||||
session.commit()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user