builder: tag the build on success
When a compose / build was successful, tag it with the destination tag. This will create a sub-task and wait for it. The individual parameter are the same used for standard "image" koji tasks.
This commit is contained in:
parent
f39f7ef4b0
commit
20abf9a142
1 changed files with 18 additions and 0 deletions
|
|
@ -283,6 +283,22 @@ class OSBuildImage(BaseTaskHandler):
|
|||
self.logger.debug("user repo override: %s", str(repos))
|
||||
return [Repository(r) for r in repos]
|
||||
|
||||
def tag_build(self, tag, build_id):
|
||||
args = [
|
||||
tag, # tag id
|
||||
build_id, # build id
|
||||
False, # force
|
||||
None, # from tag
|
||||
True # ignore_success (not sending notification)
|
||||
]
|
||||
|
||||
task = self.session.host.subtask(method='tagBuild',
|
||||
arglist=args,
|
||||
label='tag',
|
||||
parent=self.id,
|
||||
arch='noarch')
|
||||
self.wait(task)
|
||||
|
||||
# pylint: disable=arguments-differ
|
||||
def handler(self, name, version, distro, image_types, target, arches, opts):
|
||||
"""Main entry point for the task"""
|
||||
|
|
@ -343,6 +359,8 @@ class OSBuildImage(BaseTaskHandler):
|
|||
if not status.is_success:
|
||||
raise koji.BuildError(f"Compose failed (id: {cid})")
|
||||
|
||||
self.tag_build(target_info["dest_tag"], bid)
|
||||
|
||||
result = {
|
||||
"composer": {
|
||||
"server": self.composer_url,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue