| OLD | NEW |
| 1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
| 2 # Copyright (c) 2011 The Native Client Authors. All rights reserved. | 2 # Copyright (c) 2011 The Native Client 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 import os | 8 import os |
| 9 import subprocess | 9 import subprocess |
| 10 import sys | 10 import sys |
| 11 | 11 |
| 12 # Add scons to the python path (as nacl_utils.py requires it). | 12 # Add scons to the python path (as nacl_utils.py requires it). |
| 13 SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__)) | 13 SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__)) |
| 14 SDK_SRC_DIR = os.path.dirname(SCRIPT_DIR) | 14 SDK_SRC_DIR = os.path.dirname(SCRIPT_DIR) |
| 15 SDK_DIR = os.path.dirname(SDK_SRC_DIR) | 15 SDK_DIR = os.path.dirname(SDK_SRC_DIR) |
| 16 SRC_DIR = os.path.dirname(SDK_DIR) | 16 SRC_DIR = os.path.dirname(SDK_DIR) |
| 17 sys.path.append(os.path.join(SRC_DIR, 'third_party/scons-2.0.1/engine')) | 17 sys.path.append(os.path.join(SRC_DIR, 'third_party/scons-2.0.1/engine')) |
| 18 | 18 |
| 19 import build_utils | 19 import build_utils |
| 20 | 20 |
| 21 | 21 |
| 22 def Archive(revision, chrome_milestone): | 22 def Archive(revision, chrome_version): |
| 23 """Archive the sdk to google storage. | 23 """Archive the sdk to google storage. |
| 24 | 24 |
| 25 Args: | 25 Args: |
| 26 revision: SDK svn revision number. | 26 revision: SDK svn revision number. |
| 27 chrome_milestone: Chrome milestone (m14 etc), this is for. | 27 chrome_version: Chrome version number / trunk svn. |
| 28 """ | 28 """ |
| 29 if sys.platform in ['cygwin', 'win32']: | 29 if sys.platform in ['cygwin', 'win32']: |
| 30 src = 'nacl-sdk.exe' | 30 src = 'nacl-sdk.exe' |
| 31 dst = 'naclsdk_win.exe' | 31 dst = 'naclsdk_win.exe' |
| 32 elif sys.platform in ['darwin']: | 32 elif sys.platform in ['darwin']: |
| 33 src = 'nacl-sdk.tgz' | 33 src = 'nacl-sdk.tgz' |
| 34 dst = 'naclsdk_mac.tgz' | 34 dst = 'naclsdk_mac.tgz' |
| 35 else: | 35 else: |
| 36 src = 'nacl-sdk.tgz' | 36 src = 'nacl-sdk.tgz' |
| 37 dst = 'naclsdk_linux.tgz' | 37 dst = 'naclsdk_linux.tgz' |
| 38 bucket_path = 'nativeclient-mirror/nacl/nacl_sdk/pepper_%s_%s/%s' % ( | 38 bucket_path = 'nativeclient-mirror/nacl/nacl_sdk/%s/%s' % ( |
| 39 chrome_milestone, revision, dst) | 39 chrome_version, dst) |
| 40 full_dst = 'gs://%s' % bucket_path | 40 full_dst = 'gs://%s' % bucket_path |
| 41 subprocess.check_call( | 41 subprocess.check_call( |
| 42 '/b/build/scripts/slave/gsutil cp -a public-read %s %s' % ( | 42 '/b/build/scripts/slave/gsutil cp -a public-read %s %s' % ( |
| 43 src, full_dst), shell=True, cwd=SDK_DIR) | 43 src, full_dst), shell=True, cwd=SDK_DIR) |
| 44 url = 'https://commondatastorage.googleapis.com/%s' % bucket_path | 44 url = 'https://commondatastorage.googleapis.com/%s' % bucket_path |
| 45 print '@@@STEP_LINK@download@%s@@@' % url | 45 print '@@@STEP_LINK@download@%s@@@' % url |
| 46 sys.stdout.flush() | 46 sys.stdout.flush() |
| 47 | 47 |
| 48 | 48 |
| 49 def main(argv): | 49 def main(argv): |
| (...skipping 23 matching lines...) Expand all Loading... |
| 73 sys.stdout.flush() | 73 sys.stdout.flush() |
| 74 | 74 |
| 75 Run(params + ['-c']) | 75 Run(params + ['-c']) |
| 76 Run(params + ['bot', '-j1']) | 76 Run(params + ['bot', '-j1']) |
| 77 | 77 |
| 78 # Archive on non-trybots. | 78 # Archive on non-trybots. |
| 79 if '-sdk' in os.environ.get('BUILDBOT_BUILDERNAME', ''): | 79 if '-sdk' in os.environ.get('BUILDBOT_BUILDERNAME', ''): |
| 80 print '@@@BUILD_STEP archive build@@@' | 80 print '@@@BUILD_STEP archive build@@@' |
| 81 sys.stdout.flush() | 81 sys.stdout.flush() |
| 82 Archive(revision=os.environ.get('BUILDBOT_GOT_REVISION'), | 82 Archive(revision=os.environ.get('BUILDBOT_GOT_REVISION'), |
| 83 chrome_milestone=build_utils.ChromeMilestone()) | 83 chrome_version=build_utils.ChromeVersion()) |
| 84 | 84 |
| 85 return 0 | 85 return 0 |
| 86 | 86 |
| 87 | 87 |
| 88 if __name__ == '__main__': | 88 if __name__ == '__main__': |
| 89 sys.exit(main(sys.argv[1:])) | 89 sys.exit(main(sys.argv[1:])) |
| OLD | NEW |