initial import
This commit is contained in:
commit
aefe1218b5
19 changed files with 467 additions and 0 deletions
31
plugins/builder/osbuild.py
Normal file
31
plugins/builder/osbuild.py
Normal file
|
|
@ -0,0 +1,31 @@
|
|||
import koji
|
||||
|
||||
from koji.tasks import BaseTaskHandler
|
||||
|
||||
|
||||
class OSBuildImage(BaseTaskHandler):
|
||||
Methods = ['osbuildImage']
|
||||
_taskWeight = 2.0
|
||||
|
||||
def handler(self, name, version, arches, target, opts):
|
||||
self.logger.debug("Building image %s, %s, %s, %s",
|
||||
name, str(arches), str(target), str(opts))
|
||||
|
||||
#self.logger.debug("Event id: %s", str(self.event_id))
|
||||
|
||||
target_info = self.session.getBuildTarget(target, strict=True)
|
||||
build_tag = target_info['build_tag']
|
||||
repo_info = self.getRepo(build_tag)
|
||||
buildconfig = self.session.getBuildConfig(build_tag)
|
||||
|
||||
if repo_info:
|
||||
self.logger.debug("repo info: %s", str(repo_info))
|
||||
|
||||
if buildconfig:
|
||||
self.logger.debug("build-config: %s", str(buildconfig))
|
||||
|
||||
return {
|
||||
'repositories': [],
|
||||
'koji_builds': [],
|
||||
'build': 'skipped',
|
||||
}
|
||||
21
plugins/hub/osbuild.py
Normal file
21
plugins/hub/osbuild.py
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
import sys
|
||||
|
||||
import logging
|
||||
import koji
|
||||
from koji.context import context
|
||||
|
||||
sys.path.insert(0, "/usr/share/koji-hub/")
|
||||
import kojihub
|
||||
|
||||
|
||||
@koji.plugin.export
|
||||
def osbuildImageTest(name, version, arches, target, opts=None, priority=None):
|
||||
"""Create an image via osbuild"""
|
||||
context.session.assertPerm("image")
|
||||
args = [name, version, arches, target, opts]
|
||||
task = {"channel": "image"}
|
||||
|
||||
if priority and priority < 0 and not context.session.hasPerm('admin'):
|
||||
raise koji.ActionNotAllowed('only admins may create high-priority tasks')
|
||||
|
||||
return kojihub.make_task('osbuildImage', args, **task)
|
||||
Loading…
Add table
Add a link
Reference in a new issue