Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(302)

Unified Diff: recipes.py

Issue 1997023002: recipe engine: add remote_run command (Closed) Base URL: https://github.com/luci/recipes-py.git@master
Patch Set: trybots Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « recipe_engine/unittests/fetch_test.py ('k') | unittests/remote_run_test.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: recipes.py
diff --git a/recipes.py b/recipes.py
index d5955f89cc27ac6458038fb937dbc9d06cbc4ef9..79dd237c85c9371e3cf7acb2457c2f172712e3d9 100755
--- a/recipes.py
+++ b/recipes.py
@@ -147,6 +147,12 @@ def run(package_deps, args):
return handle_recipe_return(ret, args.output_result_json, stream_engine)
+def remote_run(args):
+ from recipe_engine import remote_run
+
+ return remote_run.main(args)
+
+
def autoroll(args):
from recipe_engine import autoroll
@@ -287,6 +293,23 @@ def main():
help='A list of property pairs; e.g. mastername=chromium.linux '
'issue=12345')
+ remote_run_p = subp.add_parser(
+ 'remote_run',
+ description='Run a recipe from specified repo and revision')
+ remote_run_p.set_defaults(command='remote_run')
+ remote_run_p.add_argument(
+ '--repository', required=True,
+ help='URL of a git repository to fetch')
+ remote_run_p.add_argument(
+ '--revision', default='FETCH_HEAD',
+ help='Git commit hash to check out')
+ remote_run_p.add_argument(
+ '--workdir',
+ help='The working directory of repo checkout')
+ remote_run_p.add_argument(
+ 'run_args', nargs='*',
+ help='Arguments to pass to fetched repo\'s recipes.py run')
+
autoroll_p = subp.add_parser(
'autoroll',
help='Roll dependencies of a recipe package forward (implies fetch)')
@@ -335,6 +358,11 @@ def main():
if args.verbose:
logging.getLogger().setLevel(logging.INFO)
+ # Commands which do not require config_file, package_deps, and other objects
+ # initialized later.
+ if args.command == 'remote_run':
+ return remote_run(args)
+
repo_root, config_file = get_package_config(args)
try:
« no previous file with comments | « recipe_engine/unittests/fetch_test.py ('k') | unittests/remote_run_test.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698