Add --buildbucket-bucket and --buildbucket-id to cbuildbot.
Add buildbucket_bucket and buildbucket_id options to cbuildbot.
When --use-buildbucket is used to start a build, buildbucket needs
to schedule this build and passes in those two options.
BUG=chromium:627996
TEST=manually run commands
Change-Id: I319fba9f5265348bb8b8e51c25f09cbb6a554fa5
Reviewed-on: https://chromium-review.googlesource.com/361400
Commit-Ready: Ningning Xia <nxia@chromium.org>
Tested-by: Ningning Xia <nxia@chromium.org>
Reviewed-by: Paul Hobbs <phobbs@google.com>
diff --git a/scripts/cbuildbot.py b/scripts/cbuildbot.py
index 58850e2..b95444d 100644
--- a/scripts/cbuildbot.py
+++ b/scripts/cbuildbot.py
@@ -654,6 +654,13 @@
group.add_option('--remote-trybot', dest='remote_trybot',
action='store_true', default=False,
help='Indicates this is running on a remote trybot machine')
+ group.add_option('--buildbucket-bucket', dest='buildbucket_bucket',
+ default=None,
+ help=('The destination bucket name in buildbucket to '
+ 'schedule and track current build.'))
+ group.add_option('--buildbucket-id', dest='buildbucket_id', default=None,
+ help=('The unique ID in buildbucket of current build '
+ 'generated by buildbucket.'))
group.add_remote_option('--remote-patches', action='extend', default=[],
help=('Patches uploaded by the trybot client when '
'run using the -p option'))
@@ -1197,6 +1204,10 @@
osutils.SafeMakedirs(options.log_dir)
_BackupPreviousLog(log_file)
+ if bool(options.buildbucket_bucket) ^ bool(options.buildbucket_id):
+ parser.error('buildbucket-bucket and buildbucket-id '
+ 'should be both None or both present.')
+
with cros_build_lib.ContextManagerStack() as stack:
options.preserve_paths = set()
if log_file is not None: