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 |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
56 return None | 56 return None |
57 | 57 |
58 | 58 |
59 def Usage(progname): | 59 def Usage(progname): |
60 sys.stderr.write('Usage: %s path_to_sdk\n' % progname) | 60 sys.stderr.write('Usage: %s path_to_sdk\n' % progname) |
61 | 61 |
62 | 62 |
63 def main(argv): | 63 def main(argv): |
64 #allow local editor builds to deploy to a different bucket | 64 #allow local editor builds to deploy to a different bucket |
65 if os.environ.has_key('DART_LOCAL_BUILD'): | 65 if os.environ.has_key('DART_LOCAL_BUILD'): |
66 gsdir = os.environ | 66 gsdir = os.environ['DART_LOCAL_BUILD'] |
67 else: | 67 else: |
68 gsdir = GS_DIR | 68 gsdir = GS_DIR |
69 | 69 |
70 if not os.path.exists(argv[1]): | 70 if not os.path.exists(argv[1]): |
71 sys.stderr.write('Path not found: %s\n' % argv[1]) | 71 sys.stderr.write('Path not found: %s\n' % argv[1]) |
72 Usage(argv[0]) | 72 Usage(argv[0]) |
73 return 1 | 73 return 1 |
74 if not os.path.exists(GSUTIL): | 74 if not os.path.exists(GSUTIL): |
75 #TODO: Determine where we are running, if we're running on a buildbot we | 75 #TODO: Determine where we are running, if we're running on a buildbot we |
76 #should fail with a message. | 76 #should fail with a message. |
(...skipping 19 matching lines...) Expand all Loading... |
96 ExecuteCommand(['zip', '-yr', SDK_LOCAL_ZIP, os.path.basename(argv[1])]) | 96 ExecuteCommand(['zip', '-yr', SDK_LOCAL_ZIP, os.path.basename(argv[1])]) |
97 UploadArchive(SDK_LOCAL_ZIP, | 97 UploadArchive(SDK_LOCAL_ZIP, |
98 GS_SITE + os.path.join(gsdir, GS_SDK_DIR, sdk_file)) | 98 GS_SITE + os.path.join(gsdir, GS_SDK_DIR, sdk_file)) |
99 latest_name = 'dart-%s-latest%s.zip' % (utils.GuessOS(), sdk_suffix) | 99 latest_name = 'dart-%s-latest%s.zip' % (utils.GuessOS(), sdk_suffix) |
100 UploadArchive(SDK_LOCAL_ZIP, | 100 UploadArchive(SDK_LOCAL_ZIP, |
101 GS_SITE + os.path.join(gsdir, GS_SDK_DIR, latest_name)) | 101 GS_SITE + os.path.join(gsdir, GS_SDK_DIR, latest_name)) |
102 | 102 |
103 | 103 |
104 if __name__ == '__main__': | 104 if __name__ == '__main__': |
105 sys.exit(main(sys.argv)) | 105 sys.exit(main(sys.argv)) |
OLD | NEW |