mirror of
https://pagure.io/fm-orchestrator.git
synced 2026-04-14 01:49:56 +08:00
Fix the buildroot_connect calls in repos and models and set 'system' to 'mock' when invoked from manage.py using build_module_locally
This commit is contained in:
@@ -108,6 +108,7 @@ def cleardb():
|
||||
|
||||
@manager.command
|
||||
def build_module_locally(url):
|
||||
conf.set_item("system", "mock")
|
||||
username = getpass.getuser()
|
||||
|
||||
cleardb()
|
||||
|
||||
@@ -79,7 +79,20 @@ def _finalize(config, session, msg, state):
|
||||
tag = parent.koji_tag
|
||||
builder = module_build_service.builder.GenericBuilder.create(
|
||||
parent.owner, module_name, config.system, config, tag_name=tag)
|
||||
builder.buildroot_connect()
|
||||
|
||||
try:
|
||||
groups = {
|
||||
'build': parent.resolve_profiles(session, 'buildroot'),
|
||||
'srpm-build': parent.resolve_profiles(session, 'srpm-buildroot'),
|
||||
}
|
||||
except ValueError:
|
||||
reason = "Failed to gather buildroot groups from SCM."
|
||||
log.exception(reason)
|
||||
parent.transition(config, state="failed", state_reason=reason)
|
||||
session.commit()
|
||||
raise
|
||||
|
||||
builder.buildroot_connect(groups)
|
||||
# tag && add to srpm-build group
|
||||
nvr = "{}-{}-{}".format(msg.build_name, msg.build_version,
|
||||
msg.build_release)
|
||||
|
||||
@@ -79,10 +79,22 @@ def done(config, session, msg):
|
||||
log.warn("Odd! All components in batch failed for %r." % module_build)
|
||||
return
|
||||
|
||||
try:
|
||||
groups = {
|
||||
'build': module_build.resolve_profiles(session, 'buildroot'),
|
||||
'srpm-build': module_build.resolve_profiles(session, 'srpm-buildroot'),
|
||||
}
|
||||
except ValueError:
|
||||
reason = "Failed to gather buildroot groups from SCM."
|
||||
log.exception(reason)
|
||||
module_build.transition(config, state="failed", state_reason=reason)
|
||||
session.commit()
|
||||
raise
|
||||
|
||||
builder = module_build_service.builder.GenericBuilder.create(
|
||||
module_build.owner, module_build.name, config.system, config,
|
||||
tag_name=tag)
|
||||
builder.buildroot_connect()
|
||||
builder.buildroot_connect(groups)
|
||||
|
||||
# Ok, for the subset of builds that did complete successfully, check to
|
||||
# see if they are in the buildroot.
|
||||
|
||||
Reference in New Issue
Block a user