OLD | NEW |
---|---|
(Empty) | |
1 # Copyright 2016 The Chromium Authors. All rights reserved. | |
2 # Use of this source code is governed by a BSD-style license that can be | |
3 # found in the LICENSE file. | |
4 | |
5 from __future__ import print_function | |
6 | |
7 import logging | |
8 import os | |
9 import shutil | |
10 import subprocess | |
11 import sys | |
12 import tempfile | |
13 | |
14 from recipe_engine import fetch | |
15 from recipe_engine import package | |
16 | |
17 | |
18 def real_main(args): | |
19 checkout_dir = os.path.join(args.workdir, 'checkout') | |
20 fetch.fetch_from_git(args.repository, args.revision, checkout_dir, | |
21 allow_fetch=True) | |
22 proto_file = package.ProtoFile( | |
23 package.InfraRepoConfig().to_recipes_cfg(checkout_dir)) | |
24 cmd = [ | |
martiniss
2016/05/20 17:56:31
My original design here had been to just do the fe
Paweł Hajdan Jr.
2016/05/20 21:59:57
Given it's going to be the entry point replacing k
| |
25 sys.executable, | |
26 os.path.join(checkout_dir, proto_file.read().recipes_path, 'recipes.py'), | |
iannucci1
2016/05/20 18:04:22
s/proto_file/recipes_cfg ?
proto_file will get co
Paweł Hajdan Jr.
2016/05/20 21:59:57
Done.
| |
27 'run' | |
28 ] + args.run_args | |
29 logging.info('Running %r', cmd) | |
30 return subprocess.call(cmd) | |
31 | |
32 | |
33 def main(args): | |
34 workdir_tempdir = False | |
35 if not args.workdir: | |
36 workdir_tempdir = True | |
37 args.workdir = tempfile.mkdtemp(prefix='recipe_engine_remote_run_') | |
38 logging.info('Created temporary workdir %s', args.workdir) | |
39 | |
40 try: | |
41 return real_main(args) | |
42 finally: | |
43 if workdir_tempdir: | |
44 shutil.rmtree(args.workdir) | |
iannucci1
2016/05/20 18:04:22
ignore errors?
Paweł Hajdan Jr.
2016/05/20 21:59:57
Done.
| |
OLD | NEW |