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

Side by Side Diff: recipes.py

Issue 2320223002: Revert of Track step nesting in StreamEngine. (Closed) Base URL: https://github.com/luci/recipes-py@emit-initial-properties
Patch Set: Created 4 years, 3 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 unified diff | Download patch
« no previous file with comments | « recipe_modules/step/config.py ('k') | recipes/example/nested.py » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 #!/usr/bin/env python 1 #!/usr/bin/env python
2 # Copyright 2015 The LUCI Authors. All rights reserved. 2 # Copyright 2015 The LUCI Authors. All rights reserved.
3 # Use of this source code is governed under the Apache License, Version 2.0 3 # Use of this source code is governed under the Apache License, Version 2.0
4 # that can be found in the LICENSE file. 4 # that can be found in the LICENSE file.
5 5
6 """Tool to interact with recipe repositories. 6 """Tool to interact with recipe repositories.
7 7
8 This tool operates on the nearest ancestor directory containing an 8 This tool operates on the nearest ancestor directory containing an
9 infra/config/recipes.cfg. 9 infra/config/recipes.cfg.
10 """ 10 """
(...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after
147 os.path.join(os.path.dirname(os.path.realpath(__file__)), 'workdir')) 147 os.path.join(os.path.dirname(os.path.realpath(__file__)), 'workdir'))
148 logging.info('Using %s as work directory' % workdir) 148 logging.info('Using %s as work directory' % workdir)
149 if not os.path.exists(workdir): 149 if not os.path.exists(workdir):
150 os.makedirs(workdir) 150 os.makedirs(workdir)
151 151
152 old_cwd = os.getcwd() 152 old_cwd = os.getcwd()
153 os.chdir(workdir) 153 os.chdir(workdir)
154 stream_engine = stream.ProductStreamEngine( 154 stream_engine = stream.ProductStreamEngine(
155 stream.StreamEngineInvariants(), 155 stream.StreamEngineInvariants(),
156 stream.AnnotatorStreamEngine( 156 stream.AnnotatorStreamEngine(
157 sys.stdout, 157 sys.stdout, emit_timestamps=(args.timestamps or
158 emit_timestamps=(args.timestamps or 158 op_args.annotation_flags.emit_timestamp)))
159 op_args.annotation_flags.emit_timestamp)))
160 with stream_engine: 159 with stream_engine:
161 # Emit initial properties if configured to do so. 160 # Emit initial properties if configured to do so.
162 if op_args.annotation_flags.emit_initial_properties: 161 if op_args.annotation_flags.emit_initial_properties:
163 with stream_engine.new_step_stream('Initial Properties') as s: 162 with stream_engine.new_step_stream('Initial Properties') as s:
164 for key in sorted(properties.iterkeys()): 163 for key in sorted(properties.iterkeys()):
165 s.set_build_property(key, json.dumps(properties[key], sort_keys=True)) 164 s.set_build_property(key, json.dumps(properties[key], sort_keys=True))
166 165
167 try: 166 try:
168 ret = recipe_run.run_steps( 167 ret = recipe_run.run_steps(
169 properties, stream_engine, 168 properties, stream_engine,
(...skipping 397 matching lines...) Expand 10 before | Expand all | Expand 10 after
567 ret = main() 566 ret = main()
568 if not isinstance(ret, int): 567 if not isinstance(ret, int):
569 if ret is None: 568 if ret is None:
570 ret = 0 569 ret = 0
571 else: 570 else:
572 print >> sys.stderr, ret 571 print >> sys.stderr, ret
573 ret = 1 572 ret = 1
574 sys.stdout.flush() 573 sys.stdout.flush()
575 sys.stderr.flush() 574 sys.stderr.flush()
576 os._exit(ret) 575 os._exit(ret)
OLDNEW
« no previous file with comments | « recipe_modules/step/config.py ('k') | recipes/example/nested.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698