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 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
62 if os.environ.has_key('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 #TODO: Determine where we are running, if we're running on a buildbot we |
| 73 #should fail with a message. |
| 74 #If we are not on a buildbot then fail silently. |
73 exit(0) | 75 exit(0) |
74 revision = GetSVNRevision() | 76 revision = GetSVNRevision() |
75 if revision is None: | 77 if revision is None: |
76 sys.stderr.write('Unable to find SVN revision.\n') | 78 sys.stderr.write('Unable to find SVN revision.\n') |
77 return 1 | 79 return 1 |
78 os.chdir(argv[1]) | 80 os.chdir(argv[1]) |
79 # TODO(dgrove) - deal with architectures that are not ia32. | 81 # TODO(dgrove) - deal with architectures that are not ia32. |
80 sdk_name = 'dart-' + utils.GuessOS() + '-' + revision + '.zip' | 82 sdk_name = 'dart-' + utils.GuessOS() + '-' + revision + '.zip' |
81 sdk_file = '../' + sdk_name | 83 sdk_file = '../' + sdk_name |
82 ExecuteCommand(['zip', '-yr', sdk_file, '.']) | 84 ExecuteCommand(['zip', '-yr', sdk_file, '.']) |
83 UploadArchive(sdk_file, GS_SITE + os.path.join(gsdir, SDK, sdk_name)) | 85 UploadArchive(sdk_file, GS_SITE + os.path.join(gsdir, SDK, sdk_name)) |
84 latest_name = 'dart-' + utils.GuessOS() + '-latest' + '.zip' | 86 latest_name = 'dart-' + utils.GuessOS() + '-latest' + '.zip' |
85 UploadArchive(sdk_file, GS_SITE + os.path.join(gsdir, SDK, latest_name)) | 87 UploadArchive(sdk_file, GS_SITE + os.path.join(gsdir, SDK, latest_name)) |
86 | 88 |
87 | 89 |
88 if __name__ == '__main__': | 90 if __name__ == '__main__': |
89 sys.exit(main(sys.argv)) | 91 sys.exit(main(sys.argv)) |
90 | 92 |
91 | 93 |
OLD | NEW |