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 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
51 if 'Revision' in line: | 51 if 'Revision' in line: |
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 | |
62 if os.environ['DART_LOCAL_BUILD']: | |
63 gsdir = os.environ | |
64 else: | |
65 gsdir = GS_DIR | |
66 | |
61 if not os.path.exists(argv[1]): | 67 if not os.path.exists(argv[1]): |
62 sys.stderr.write('Path not found: %s\n' % argv[1]) | 68 sys.stderr.write('Path not found: %s\n' % argv[1]) |
63 Usage(argv[0]) | 69 Usage(argv[0]) |
64 return 1 | 70 return 1 |
65 if not os.path.exists(GSUTIL): | 71 if not os.path.exists(GSUTIL): |
72 sys.stderr.write('cound not find {0}'.format(GSUTIL)) | |
dgrove
2011/12/13 05:31:31
I had intentionally made this not print anything s
| |
66 exit(0) | 73 exit(0) |
67 revision = GetSVNRevision() | 74 revision = GetSVNRevision() |
68 if revision is None: | 75 if revision is None: |
69 sys.stderr.write('Unable to find SVN revision.\n') | 76 sys.stderr.write('Unable to find SVN revision.\n') |
70 return 1 | 77 return 1 |
71 os.chdir(argv[1]) | 78 os.chdir(argv[1]) |
72 # TODO(dgrove) - deal with architectures that are not ia32. | 79 # TODO(dgrove) - deal with architectures that are not ia32. |
73 sdk_name = 'dart-' + utils.GuessOS() + '-' + revision + '.zip' | 80 sdk_name = 'dart-' + utils.GuessOS() + '-' + revision + '.zip' |
74 sdk_file = '../' + sdk_name | 81 sdk_file = '../' + sdk_name |
75 ExecuteCommand(['zip', '-yr', sdk_file, '.']) | 82 ExecuteCommand(['zip', '-yr', sdk_file, '.']) |
76 UploadArchive(sdk_file, GS_SITE + os.path.join(GS_DIR, SDK, sdk_name)) | 83 UploadArchive(sdk_file, GS_SITE + os.path.join(gsdir, SDK, sdk_name)) |
77 latest_name = 'dart-' + utils.GuessOS() + '-latest' + '.zip' | 84 latest_name = 'dart-' + utils.GuessOS() + '-latest' + '.zip' |
78 UploadArchive(sdk_file, GS_SITE + os.path.join(GS_DIR, SDK, latest_name)) | 85 UploadArchive(sdk_file, GS_SITE + os.path.join(gsdir, SDK, latest_name)) |
79 | 86 |
80 | 87 |
81 if __name__ == '__main__': | 88 if __name__ == '__main__': |
82 sys.exit(main(sys.argv)) | 89 sys.exit(main(sys.argv)) |
83 | 90 |
84 | 91 |
OLD | NEW |