basic kiwi support
This commit is contained in:
parent
1bbb55e672
commit
d31306e2f6
3 changed files with 500 additions and 0 deletions
38
plugins/hub/kiwi.py
Normal file
38
plugins/hub/kiwi.py
Normal file
|
|
@ -0,0 +1,38 @@
|
|||
import koji
|
||||
import koji.tasks
|
||||
import kojihub
|
||||
|
||||
from koji.context import context
|
||||
from koji.plugin import export
|
||||
|
||||
koji.tasks.LEGACY_SIGNATURES['kiwiBuild'] = [
|
||||
[['target', 'arches', 'desc_url', 'desc_path', 'opts'],
|
||||
None, None, (None,)]]
|
||||
koji.tasks.LEGACY_SIGNATURES['createKiwiImage'] = [
|
||||
[['name', 'version', 'release', 'arch',
|
||||
'target_info', 'build_tag', 'repo_info', 'desc_url', 'opts'],
|
||||
None, None, (None,)]]
|
||||
|
||||
|
||||
@export
|
||||
def kiwiBuild(target, arches, desc_url, desc_path, optional_arches=None, profile=None,
|
||||
scratch=False, priority=None):
|
||||
context.session.assertPerm('image')
|
||||
taskOpts = {
|
||||
'channel': 'image',
|
||||
}
|
||||
if priority:
|
||||
if priority < 0:
|
||||
if not context.session.hasPerm('admin'):
|
||||
raise koji.ActionNotAllowed(
|
||||
'only admins may create high-priority tasks')
|
||||
taskOpts['priority'] = koji.PRIO_DEFAULT + priority
|
||||
|
||||
opts = {
|
||||
'optional_arches': optional_arches,
|
||||
'profile': profile,
|
||||
'scratch': scratch,
|
||||
}
|
||||
return kojihub.make_task('kiwiBuild',
|
||||
[target, arches, desc_url, desc_path, opts],
|
||||
**taskOpts)
|
||||
Loading…
Add table
Add a link
Reference in a new issue