Index: git_cl.py |
diff --git a/git_cl.py b/git_cl.py |
index caa9b604b2d54800f8b4d0a0ebc5851d91b930bf..61a8457ff62f90a1c8866c96659b0e7386c3b8a0 100755 |
--- a/git_cl.py |
+++ b/git_cl.py |
@@ -39,6 +39,7 @@ from third_party import colorama |
from third_party import httplib2 |
from third_party import upload |
import auth |
+from luci_hacks import trigger_luci_job as luci_trigger |
import breakpad # pylint: disable=W0611 |
import clang_format |
import dart_format |
@@ -228,6 +229,20 @@ def _prefix_master(master): |
return '%s%s' % (prefix, master) |
+def trigger_luci_job(changelist, masters, options): |
+ """Send a job to run on LUCI.""" |
+ try_py = os.path.join( |
+ os.path.dirname( |
+ os.path.abspath(__file__)), 'luci_hacks', 'luci_recipe_run.py') |
+ issue_props = changelist.GetIssueProperties() |
+ issue = changelist.GetIssue() |
+ patchset = changelist.GetMostRecentPatchset() |
+ for _, builders_and_tests in sorted(masters.iteritems()): |
estaab
2015/09/15 23:05:14
itervalues()
Ryan Tseng
2015/09/17 23:39:23
Done.
|
+ for builder, _ in sorted(builders_and_tests.iteritems()): |
estaab
2015/09/15 23:05:14
iterkeys()
Ryan Tseng
2015/09/17 23:39:23
Done.
|
+ luci_trigger.trigger( |
+ builder, 'HEAD', issue, patchset, issue_props['project']) |
+ |
+ |
def trigger_try_jobs(auth_config, changelist, options, masters, category, |
override_properties=None): |
rietveld_url = settings.GetDefaultServerUrl() |
@@ -3059,6 +3074,7 @@ def CMDtry(parser, args): |
group.add_option( |
"-m", "--master", default='', |
help=("Specify a try master where to run the tries.")) |
+ group.add_option( "--luci", action='store_true') |
group.add_option( |
"-r", "--revision", |
help="Revision to use for the try job; default: the " |
@@ -3177,7 +3193,9 @@ def CMDtry(parser, args): |
'\nWARNING Mismatch between local config and server. Did a previous ' |
'upload fail?\ngit-cl try always uses latest patchset from rietveld. ' |
'Continuing using\npatchset %s.\n' % patchset) |
- if not options.use_rietveld: |
+ if options.luci: |
+ trigger_luci_job(cl, masters, options) |
+ elif not options.use_rietveld: |
try: |
trigger_try_jobs(auth_config, cl, options, masters, 'git_cl_try') |
except BuildbucketResponseException as ex: |