Chromium Code Reviews| Index: buildbot/cbuildbot.py |
| diff --git a/buildbot/cbuildbot.py b/buildbot/cbuildbot.py |
| index 14cba0bf717fbe7fc07d3b37b021dcd5741230ea..73dcf926a94fa1be4b7d85c65cdb6c0c89b7421b 100755 |
| --- a/buildbot/cbuildbot.py |
| +++ b/buildbot/cbuildbot.py |
| @@ -26,7 +26,7 @@ import chromite.buildbot.cbuildbot_stages as stages |
| import chromite.lib.cros_build_lib as cros_lib |
| -def _GetConfig(config_name): |
| +def _GetConfig(config_name, options): |
| """Gets the configuration for the build""" |
| build_config = {} |
| if not cbuildbot_config.config.has_key(config_name): |
| @@ -38,14 +38,23 @@ def _GetConfig(config_name): |
| Warning(' %s' % name) |
| sys.exit(1) |
| - return cbuildbot_config.config[config_name] |
| + result = cbuildbot_config.config[config_name][:] |
| + |
| + # Use the config specific url, if not given on command line. |
| + if options.url: |
| + result['git_url'] = options.url |
| + |
| + return result |
| def RunBuildStages(bot_id, options, build_config): |
| """Run the requested build stages.""" |
| try: |
| if options.sync: |
| - stages.SyncStage(bot_id, options, build_config).Run() |
| + if build_config['manifest_version']: |
| + stages.ManifestVersionedSyncStage(bot_id, options, build_config).Run() |
| + else: |
| + stages.SyncStage(bot_id, options, build_config).Run() |
| if options.build: |
| stages.BuildBoardStage(bot_id, options, build_config).Run() |
| @@ -81,11 +90,22 @@ def RunBuildStages(bot_id, options, build_config): |
| cros_lib.Info('BUILD ARTIFACTS FOR THIS BUILD CAN BE FOUND AT:') |
| cros_lib.Info(stages.BuilderStage.archive_url) |
| + if options.sync and build_config['manifest_version']: |
| + stages.ManifestVersionedSyncCompletionStage(bot_id, |
|
sosa
2011/04/11 19:03:54
indentation is wrong here
dgarrett
2011/04/11 20:53:13
Done.
|
| + options, |
| + build_config, |
| + success=True).Run() |
| + |
| except: |
| # Send failure to master. |
|
sosa
2011/04/11 19:03:54
Maybe the two of these should be combined into a R
dgarrett
2011/04/11 20:53:13
If that could be done for both success and failure
sosa
2011/04/11 23:34:01
I think maybe you should just make it into one sta
|
| if not build_config['master'] and build_config['important']: |
| cbuildbot_comm.PublishStatus(cbuildbot_comm.STATUS_BUILD_FAILED) |
| + if options.sync and build_config['manifest_version']: |
| + stages.ManifestVersionedSyncCompletionStage(bot_id, |
| + options, |
| + build_config, |
| + success=False).Run() |
| raise |
| @@ -166,14 +186,14 @@ def main(): |
| default=True, |
| help='Override values from buildconfig and never uprev.') |
| parser.add_option('-u', '--url', dest='url', |
| - default='http://git.chromium.org/git/manifest', |
| + default=None, |
| help='Run the buildbot on internal manifest') |
|
sosa
2011/04/11 19:03:54
Change help to indicate an override of config.
dgarrett
2011/04/11 20:53:13
Done.
|
| (options, args) = parser.parse_args() |
| if len(args) >= 1: |
| bot_id = args[-1] |
| - build_config = _GetConfig(bot_id) |
| + build_config = _GetConfig(bot_id, options) |
| else: |
| parser.error('Invalid usage. Use -h to see usage.') |