OLD | NEW |
1 #!/usr/bin/python | 1 #!/usr/bin/python |
2 | 2 |
3 # Copyright (c) 2011 The Chromium Authors. All rights reserved. | 3 # Copyright (c) 2011 The Chromium Authors. All rights reserved. |
4 # Use of this source code is governed by a BSD-style license that can be | 4 # Use of this source code is governed by a BSD-style license that can be |
5 # found in the LICENSE file. | 5 # found in the LICENSE file. |
6 | 6 |
7 # This zips the SDK and uploads it to Google Storage when run on a buildbot. | 7 # This zips the SDK and uploads it to Google Storage when run on a buildbot. |
8 # | 8 # |
9 # Usage: upload_sdk.py path_to_sdk | 9 # Usage: upload_sdk.py path_to_sdk |
10 | 10 |
11 import os | 11 import os |
12 import os.path | 12 import os.path |
13 import platform | 13 import platform |
14 import subprocess | 14 import subprocess |
15 import sys | 15 import sys |
16 import utils | 16 import utils |
17 | 17 |
18 | 18 |
19 GSUTIL = '/b/build/scripts/slave/gsutil' | 19 GSUTIL = utils.GetBuildbotGSUtilPath() |
20 HAS_SHELL = False | 20 HAS_SHELL = False |
21 if platform.system() == 'Windows': | 21 if platform.system() == 'Windows': |
22 GSUTIL = 'e:\\\\b\\build\\scripts\\slave\\gsutil' | |
23 HAS_SHELL = True | 22 HAS_SHELL = True |
24 GS_SITE = 'gs://' | 23 GS_SITE = 'gs://' |
25 GS_DIR = 'dart-dump-render-tree' | 24 GS_DIR = 'dart-dump-render-tree' |
26 GS_SDK_DIR = 'sdk' | 25 GS_SDK_DIR = 'sdk' |
27 SDK_LOCAL_ZIP = "dart-sdk.zip" | 26 SDK_LOCAL_ZIP = "dart-sdk.zip" |
28 SDK_LOCAL_TARGZ = "dart-sdk.tar.gz" | 27 SDK_LOCAL_TARGZ = "dart-sdk.tar.gz" |
29 | 28 |
30 def ExecuteCommand(cmd): | 29 def ExecuteCommand(cmd): |
31 """Execute a command in a subprocess. | 30 """Execute a command in a subprocess. |
32 """ | 31 """ |
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
114 UploadArchive(SDK_LOCAL_ZIP, | 113 UploadArchive(SDK_LOCAL_ZIP, |
115 GS_SITE + '/'.join([gsdir, GS_SDK_DIR, latest_name_zip])) | 114 GS_SITE + '/'.join([gsdir, GS_SDK_DIR, latest_name_zip])) |
116 if (os.path.exists(SDK_LOCAL_TARGZ)): | 115 if (os.path.exists(SDK_LOCAL_TARGZ)): |
117 UploadArchive(SDK_LOCAL_TARGZ, | 116 UploadArchive(SDK_LOCAL_TARGZ, |
118 GS_SITE + '/'.join([gsdir, GS_SDK_DIR, latest_name_targz])) | 117 GS_SITE + '/'.join([gsdir, GS_SDK_DIR, latest_name_targz])) |
119 utils.Touch('upload.stamp') | 118 utils.Touch('upload.stamp') |
120 | 119 |
121 | 120 |
122 if __name__ == '__main__': | 121 if __name__ == '__main__': |
123 sys.exit(main(sys.argv)) | 122 sys.exit(main(sys.argv)) |
OLD | NEW |