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

Side by Side Diff: scripts/slave/recipe_modules/chromite/api.py

Issue 2324733005: BuildBucket recipe module can expose properties. (Closed)
Patch Set: Remove parenthesis. 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 | « scripts/slave/recipe_modules/chromite/__init__.py ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 # Copyright 2013 The Chromium Authors. All rights reserved. 1 # Copyright 2013 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be 2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file. 3 # found in the LICENSE file.
4 4
5 import cgi 5 import cgi
6 import re 6 import re
7 7
8 from recipe_engine import recipe_api 8 from recipe_engine import recipe_api
9 9
10 10
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
63 def get_config_defaults(self): 63 def get_config_defaults(self):
64 defaults = { 64 defaults = {
65 'CBB_CONFIG': self.m.properties.get('cbb_config'), 65 'CBB_CONFIG': self.m.properties.get('cbb_config'),
66 'CBB_BRANCH': self.m.properties.get('cbb_branch'), 66 'CBB_BRANCH': self.m.properties.get('cbb_branch'),
67 'CBB_DEBUG': self.m.properties.get('cbb_debug') is not None, 67 'CBB_DEBUG': self.m.properties.get('cbb_debug') is not None,
68 'CBB_CLOBBER': 'clobber' in self.m.properties, 68 'CBB_CLOBBER': 'clobber' in self.m.properties,
69 } 69 }
70 if 'buildnumber' in self.m.properties: 70 if 'buildnumber' in self.m.properties:
71 defaults['CBB_BUILD_NUMBER'] = int(self.m.properties['buildnumber']) 71 defaults['CBB_BUILD_NUMBER'] = int(self.m.properties['buildnumber'])
72 72
73 if 'buildbucket' in self.m.properties: 73 buildbucket_props = self.m.buildbucket.properties
74 buildbucket_json = self.m.json.loads(self.m.properties.get('buildbucket')) 74 if buildbucket_props:
75 defaults['CBB_BUILDBUCKET_ID'] = buildbucket_json['build']['id'] 75 defaults['CBB_BUILDBUCKET_ID'] = buildbucket_props['build']['id']
76 76
77 return defaults 77 return defaults
78 78
79 def _load_config_dump(self): 79 def _load_config_dump(self):
80 if not self._cached_config: 80 if not self._cached_config:
81 config_path = self.m.path.join(self.chromite_path, 81 config_path = self.m.path.join(self.chromite_path,
82 'cbuildbot', 'config_dump.json') 82 'cbuildbot', 'config_dump.json')
83 step_result = self.m.json.read('read chromite config', config_path, 83 step_result = self.m.json.read('read chromite config', config_path,
84 add_json_log=False) 84 add_json_log=False)
85 self._cached_config = step_result.json.output 85 self._cached_config = step_result.json.output
(...skipping 276 matching lines...) Expand 10 before | Expand all | Expand 10 after
362 cbb_args.extend(['--master-build-id', self.c.cbb.build_id]) 362 cbb_args.extend(['--master-build-id', self.c.cbb.build_id])
363 363
364 # Add custom args, if there are any. 364 # Add custom args, if there are any.
365 cbb_args.extend(args) 365 cbb_args.extend(args)
366 366
367 # Run cbuildbot. 367 # Run cbuildbot.
368 return self.cbuildbot(str('cbuildbot [%s]' % (self.c.cbb.config,)), 368 return self.cbuildbot(str('cbuildbot [%s]' % (self.c.cbb.config,)),
369 self.c.cbb.config, 369 self.c.cbb.config,
370 args=cbb_args, 370 args=cbb_args,
371 cwd=self.m.path['slave_build']) 371 cwd=self.m.path['slave_build'])
OLDNEW
« no previous file with comments | « scripts/slave/recipe_modules/chromite/__init__.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698