OLD | NEW |
1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
2 # | 2 # |
3 # Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file | 3 # Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file |
4 # for details. All rights reserved. Use of this source code is governed by a | 4 # for details. All rights reserved. Use of this source code is governed by a |
5 # BSD-style license that can be found in the LICENSE file. | 5 # BSD-style license that can be found in the LICENSE file. |
6 | 6 |
7 import os.path | 7 import os.path |
8 import shutil | 8 import shutil |
9 import sys | 9 import sys |
10 | 10 |
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
100 % apidocs_destination_gcsdir) | 100 % apidocs_destination_gcsdir) |
101 return | 101 return |
102 | 102 |
103 # Upload everything inside the built apidocs directory. | 103 # Upload everything inside the built apidocs directory. |
104 gsutil = bot_utils.GSUtil() | 104 gsutil = bot_utils.GSUtil() |
105 gsutil.upload(dir_name, apidocs_destination_gcsdir, recursive=True, | 105 gsutil.upload(dir_name, apidocs_destination_gcsdir, recursive=True, |
106 public=True) | 106 public=True) |
107 | 107 |
108 # Update latest.txt to contain the newest revision. | 108 # Update latest.txt to contain the newest revision. |
109 with utils.TempDir('latest_file') as temp_dir: | 109 with utils.TempDir('latest_file') as temp_dir: |
110 latest_file = join(temp_dir, 'latest.txt') | 110 latest_file = os.path.join(temp_dir, 'latest.txt') |
111 with open(latest_file, 'w') as f: | 111 with open(latest_file, 'w') as f: |
112 f.write('%s' % revision) | 112 f.write('%s' % revision) |
113 DartArchiveFile(latest_file, apidocs_destination_latestfile) | 113 DartArchiveFile(latest_file, apidocs_destination_latestfile) |
114 | 114 |
115 def GsutilExists(gsu_path): | 115 def GsutilExists(gsu_path): |
116 # This is a little hackish, but it is basically a one off doing very | 116 # This is a little hackish, but it is basically a one off doing very |
117 # specialized check that we don't use elsewhere. | 117 # specialized check that we don't use elsewhere. |
118 gsutilTool = os.path.join(bot_utils.DART_DIR, | 118 gsutilTool = os.path.join(bot_utils.DART_DIR, |
119 'third_party', 'gsutil', 'gsutil') | 119 'third_party', 'gsutil', 'gsutil') |
120 (_, stderr, returncode) = bot_utils.run( | 120 (_, stderr, returncode) = bot_utils.run( |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
168 gsutil.upload(local_sha256, remote_path + '.sha256sum', public=True) | 168 gsutil.upload(local_sha256, remote_path + '.sha256sum', public=True) |
169 | 169 |
170 def Run(command): | 170 def Run(command): |
171 print "Running %s" % ' '.join(command) | 171 print "Running %s" % ' '.join(command) |
172 return bot.RunProcess(command) | 172 return bot.RunProcess(command) |
173 | 173 |
174 if __name__ == '__main__': | 174 if __name__ == '__main__': |
175 CreateUploadSDK() | 175 CreateUploadSDK() |
176 if BUILD_OS == 'linux': | 176 if BUILD_OS == 'linux': |
177 CreateUploadAPIDocs() | 177 CreateUploadAPIDocs() |
OLD | NEW |