support --wait-repo/--wait-build in wrapper-rpm command
This commit is contained in:
parent
2df628b41f
commit
91d743c35a
2 changed files with 11 additions and 7 deletions
|
|
@ -2256,7 +2256,8 @@ class WrapperRPMTask(BaseBuildTask):
|
||||||
if not repo_id:
|
if not repo_id:
|
||||||
# a parent task will generally pass in the repo it used, but if
|
# a parent task will generally pass in the repo it used, but if
|
||||||
# we are top level, we'll need to find our own
|
# we are top level, we'll need to find our own
|
||||||
repo_info = self.getRepo(build_tag['id'])
|
repo_info = self.getRepo(build_tag['id'], builds=opts.get('wait_builds'),
|
||||||
|
wait=opts.get('wait_repo')) # (subtask)
|
||||||
else:
|
else:
|
||||||
repo_info = self.session.repoInfo(repo_id, strict=True)
|
repo_info = self.session.repoInfo(repo_id, strict=True)
|
||||||
repo_id = repo_info['id']
|
repo_id = repo_info['id']
|
||||||
|
|
|
||||||
|
|
@ -835,6 +835,10 @@ def handle_wrapper_rpm(options, session, args):
|
||||||
help="Run the build at a lower priority")
|
help="Run the build at a lower priority")
|
||||||
parser.add_option("--create-draft", action="store_true",
|
parser.add_option("--create-draft", action="store_true",
|
||||||
help="Create a new draft build instead")
|
help="Create a new draft build instead")
|
||||||
|
parser.add_option("--wait-repo", action="store_true",
|
||||||
|
help="Wait for a current repo for the build tag")
|
||||||
|
parser.add_option("--wait-build", metavar="NVR", action="append", dest="wait_builds",
|
||||||
|
default=[], help="Wait for the given nvr to appear in buildroot repo")
|
||||||
|
|
||||||
(build_opts, args) = parser.parse_args(args)
|
(build_opts, args) = parser.parse_args(args)
|
||||||
if build_opts.inis:
|
if build_opts.inis:
|
||||||
|
|
@ -879,14 +883,13 @@ def handle_wrapper_rpm(options, session, args):
|
||||||
if build_opts.background:
|
if build_opts.background:
|
||||||
priority = 5
|
priority = 5
|
||||||
opts = {}
|
opts = {}
|
||||||
if build_opts.create_build:
|
|
||||||
opts['create_build'] = True
|
|
||||||
if build_opts.skip_tag:
|
|
||||||
opts['skip_tag'] = True
|
|
||||||
if build_opts.scratch:
|
|
||||||
opts['scratch'] = True
|
|
||||||
if build_opts.create_draft:
|
if build_opts.create_draft:
|
||||||
opts['draft'] = True
|
opts['draft'] = True
|
||||||
|
# the other passthough opts have matching names
|
||||||
|
for key in ('create_build', 'skip_tag', 'scratch', 'wait_repo', 'wait_builds'):
|
||||||
|
val = getattr(build_opts, key)
|
||||||
|
if val is not None:
|
||||||
|
opts[key] = val
|
||||||
task_id = session.wrapperRPM(build_id, url, target, priority, opts=opts)
|
task_id = session.wrapperRPM(build_id, url, target, priority, opts=opts)
|
||||||
print("Created task: %d" % task_id)
|
print("Created task: %d" % task_id)
|
||||||
print("Task info: %s/taskinfo?taskID=%s" % (options.weburl, task_id))
|
print("Task info: %s/taskinfo?taskID=%s" % (options.weburl, task_id))
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue