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 import os | 9 import os |
10 import subprocess | 10 import subprocess |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
52 return (line.strip().split())[1] | 52 return (line.strip().split())[1] |
53 return None | 53 return None |
54 | 54 |
55 | 55 |
56 def Usage(progname): | 56 def Usage(progname): |
57 sys.stderr.write('Usage: %s path_to_sdk\n' % progname) | 57 sys.stderr.write('Usage: %s path_to_sdk\n' % progname) |
58 | 58 |
59 | 59 |
60 def main(argv): | 60 def main(argv): |
61 #allow local editor builds to deploy to a different bucket | 61 #allow local editor builds to deploy to a different bucket |
62 if os.environ['DART_LOCAL_BUILD']: | 62 if os.environ.has_key('DART_LOCAL_BUILD'): |
63 gsdir = os.environ | 63 gsdir = os.environ |
64 else: | 64 else: |
65 gsdir = GS_DIR | 65 gsdir = GS_DIR |
66 | 66 |
67 if not os.path.exists(argv[1]): | 67 if not os.path.exists(argv[1]): |
68 sys.stderr.write('Path not found: %s\n' % argv[1]) | 68 sys.stderr.write('Path not found: %s\n' % argv[1]) |
69 Usage(argv[0]) | 69 Usage(argv[0]) |
70 return 1 | 70 return 1 |
71 if not os.path.exists(GSUTIL): | 71 if not os.path.exists(GSUTIL): |
72 sys.stderr.write('cound not find {0}'.format(GSUTIL)) | 72 sys.stderr.write('cound not find {0}'.format(GSUTIL)) |
73 exit(0) | 73 exit(0) |
74 revision = GetSVNRevision() | 74 revision = GetSVNRevision() |
75 if revision is None: | 75 if revision is None: |
76 sys.stderr.write('Unable to find SVN revision.\n') | 76 sys.stderr.write('Unable to find SVN revision.\n') |
77 return 1 | 77 return 1 |
78 os.chdir(argv[1]) | 78 os.chdir(argv[1]) |
79 # TODO(dgrove) - deal with architectures that are not ia32. | 79 # TODO(dgrove) - deal with architectures that are not ia32. |
80 sdk_name = 'dart-' + utils.GuessOS() + '-' + revision + '.zip' | 80 sdk_name = 'dart-' + utils.GuessOS() + '-' + revision + '.zip' |
81 sdk_file = '../' + sdk_name | 81 sdk_file = '../' + sdk_name |
82 ExecuteCommand(['zip', '-yr', sdk_file, '.']) | 82 ExecuteCommand(['zip', '-yr', sdk_file, '.']) |
83 UploadArchive(sdk_file, GS_SITE + os.path.join(gsdir, SDK, sdk_name)) | 83 UploadArchive(sdk_file, GS_SITE + os.path.join(gsdir, SDK, sdk_name)) |
84 latest_name = 'dart-' + utils.GuessOS() + '-latest' + '.zip' | 84 latest_name = 'dart-' + utils.GuessOS() + '-latest' + '.zip' |
85 UploadArchive(sdk_file, GS_SITE + os.path.join(gsdir, SDK, latest_name)) | 85 UploadArchive(sdk_file, GS_SITE + os.path.join(gsdir, SDK, latest_name)) |
86 | 86 |
87 | 87 |
88 if __name__ == '__main__': | 88 if __name__ == '__main__': |
89 sys.exit(main(sys.argv)) | 89 sys.exit(main(sys.argv)) |
90 | 90 |
91 | 91 |
OLD | NEW |