| OLD | NEW |
| 1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
| 2 # Copyright (c) 2012 The Chromium Authors. All rights reserved. | 2 # Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 3 # Use of this source code is governed by a BSD-style license that can be | 3 # Use of this source code is governed by a BSD-style license that can be |
| 4 # found in the LICENSE file. | 4 # found in the LICENSE file. |
| 5 | 5 |
| 6 """Entry point for both build and try bots | 6 """Entry point for both build and try bots |
| 7 | 7 |
| 8 This script is invoked from XXX, usually without arguments. | 8 This script is invoked from XXX, usually without arguments. |
| 9 | 9 |
| 10 To determin which commands to run, the script inspects the environment: | 10 To determin which commands to run, the script inspects the environment: |
| 11 BUILDBOT_BUILDERNAME | 11 BUILDBOT_BUILDERNAME |
| 12 """ | 12 """ |
| 13 | 13 |
| 14 | 14 |
| 15 import buildbot_common | 15 import buildbot_common |
| 16 import os | 16 import os |
| 17 import sys | 17 import sys |
| 18 | 18 |
| 19 # Set the directory that this script lives in. | 19 # Set the directory that this script lives in. |
| 20 SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__)) | 20 SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__)) |
| 21 | 21 |
| 22 | 22 |
| 23 SDK_BUILDER_MAP = { | 23 SDK_BUILDER_MAP = { |
| 24 'linux-sdk-mono32': | 24 'linux-sdk-mono32': |
| 25 [sys.executable, 'nacl-mono-buildbot.py'], | 25 [sys.executable, 'nacl-mono-buildbot.py'], |
| 26 'linux-sdk-mono64': | 26 'linux-sdk-mono64': |
| 27 ['/bin/true'], | 27 [sys.executable, 'nacl-mono-buildbot.py'], |
| 28 'DEFAULT': | 28 'DEFAULT': |
| 29 [sys.executable, 'build_sdk.py'], | 29 [sys.executable, 'build_sdk.py'], |
| 30 } | 30 } |
| 31 | 31 |
| 32 | 32 |
| 33 def main(args): | 33 def main(args): |
| 34 args = args[1:] | 34 args = args[1:] |
| 35 buildername = os.environ.get('BUILDBOT_BUILDERNAME', '') | 35 buildername = os.environ.get('BUILDBOT_BUILDERNAME', '') |
| 36 cmd = SDK_BUILDER_MAP.get(buildername) or SDK_BUILDER_MAP.get('DEFAULT') | 36 cmd = SDK_BUILDER_MAP.get(buildername) or SDK_BUILDER_MAP.get('DEFAULT') |
| 37 buildbot_common.Run(cmd + args, cwd=SCRIPT_DIR) | 37 buildbot_common.Run(cmd + args, cwd=SCRIPT_DIR) |
| 38 return 0 | 38 return 0 |
| 39 | 39 |
| 40 | 40 |
| 41 if __name__ == '__main__': | 41 if __name__ == '__main__': |
| 42 sys.exit(main(sys.argv)) | 42 sys.exit(main(sys.argv)) |
| OLD | NEW |