Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(691)

Side by Side Diff: tools/bots/bot_utils.py

Issue 1164423008: add dartdoc to third_party/pkg, run dartdoc to generate docs for sdk and upload to GCS (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: fix long line Created 5 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « DEPS ('k') | tools/bots/dart_sdk.py » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 #!/usr/bin/env python 1 #!/usr/bin/env python
2 # 2 #
3 # Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 3 # Copyright (c) 2012, 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 hashlib 7 import hashlib
8 import imp 8 import imp
9 import os 9 import os
10 import platform 10 import platform
(...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after
162 self.release_type, revision, name) 162 self.release_type, revision, name)
163 163
164 # Functions for quering filenames 164 # Functions for quering filenames
165 165
166 def dartium_android_apk_filename(self, name, arch, mode): 166 def dartium_android_apk_filename(self, name, arch, mode):
167 return '%s-%s-%s.apk' % (name, arch, mode) 167 return '%s-%s-%s.apk' % (name, arch, mode)
168 168
169 def apidocs_zipfilename(self): 169 def apidocs_zipfilename(self):
170 return 'dart-api-docs.zip' 170 return 'dart-api-docs.zip'
171 171
172 def dartdocs_zipfilename(self):
173 return 'dartdocs-gen-api.zip'
174
172 def editor_zipfilename(self, system, arch): 175 def editor_zipfilename(self, system, arch):
173 return 'darteditor-%s-%s.zip' % ( 176 return 'darteditor-%s-%s.zip' % (
174 SYSTEM_RENAMES[system], ARCH_RENAMES[arch]) 177 SYSTEM_RENAMES[system], ARCH_RENAMES[arch])
175 178
176 def editor_android_zipfilename(self): 179 def editor_android_zipfilename(self):
177 return 'android.zip' 180 return 'android.zip'
178 181
179 def editor_installer_filename(self, system, arch, extension): 182 def editor_installer_filename(self, system, arch, extension):
180 assert extension in ['dmg', 'msi'] 183 assert extension in ['dmg', 'msi']
181 return 'darteditor-installer-%s-%s.%s' % ( 184 return 'darteditor-installer-%s-%s.%s' % (
(...skipping 14 matching lines...) Expand all
196 def __init__(self, channel=Channel.BLEEDING_EDGE): 199 def __init__(self, channel=Channel.BLEEDING_EDGE):
197 assert channel in Channel.ALL_CHANNELS 200 assert channel in Channel.ALL_CHANNELS
198 201
199 self.channel = channel 202 self.channel = channel
200 self.bucket = 'gs://dartlang-api-docs' 203 self.bucket = 'gs://dartlang-api-docs'
201 204
202 def docs_dirpath(self, revision): 205 def docs_dirpath(self, revision):
203 assert len('%s' % revision) > 0 206 assert len('%s' % revision) > 0
204 return '%s/channels/%s/%s' % (self.bucket, self.channel, revision) 207 return '%s/channels/%s/%s' % (self.bucket, self.channel, revision)
205 208
209 def dartdocs_dirpath(self, revision):
210 assert len('%s' % revision) > 0
211 return '%s/channels/%s/gen-dartdocs/%s' % (self.bucket,
212 self.channel, revision)
213
206 def docs_latestpath(self, revision): 214 def docs_latestpath(self, revision):
207 assert len('%s' % revision) > 0 215 assert len('%s' % revision) > 0
208 return '%s/channels/%s/latest.txt' % (self.bucket, self.channel) 216 return '%s/channels/%s/latest.txt' % (self.bucket, self.channel)
209 217
210 def run(command, env=None, shell=False, throw_on_error=True): 218 def run(command, env=None, shell=False, throw_on_error=True):
211 print "Running command: ", command 219 print "Running command: ", command
212 220
213 p = subprocess.Popen(command, stdout=subprocess.PIPE, 221 p = subprocess.Popen(command, stdout=subprocess.PIPE,
214 stderr=subprocess.PIPE, env=env, shell=shell) 222 stderr=subprocess.PIPE, env=env, shell=shell)
215 (stdout, stderr) = p.communicate() 223 (stdout, stderr) = p.communicate()
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
271 279
272 if GSUtil.GSUTIL_IS_SHELL_SCRIPT: 280 if GSUtil.GSUTIL_IS_SHELL_SCRIPT:
273 gsutil_command = [GSUtil.GSUTIL_PATH] 281 gsutil_command = [GSUtil.GSUTIL_PATH]
274 else: 282 else:
275 gsutil_command = [sys.executable, GSUtil.GSUTIL_PATH] 283 gsutil_command = [sys.executable, GSUtil.GSUTIL_PATH]
276 284
277 return run(gsutil_command + gsutil_args, env=env, 285 return run(gsutil_command + gsutil_args, env=env,
278 shell=(GSUtil.GSUTIL_IS_SHELL_SCRIPT and 286 shell=(GSUtil.GSUTIL_IS_SHELL_SCRIPT and
279 sys.platform == 'win32')) 287 sys.platform == 'win32'))
280 288
281 def upload(self, local_path, remote_path, recursive=False, public=False): 289 def upload(self, local_path, remote_path, recursive=False,
290 public=False, multithread=False):
282 assert remote_path.startswith('gs://') 291 assert remote_path.startswith('gs://')
283 292
284 args = ['cp'] 293 if multithread:
294 args = ['-m', 'cp']
295 else:
296 args = ['cp']
285 if public: 297 if public:
286 args += ['-a', 'public-read'] 298 args += ['-a', 'public-read']
287 if recursive: 299 if recursive:
288 args += ['-R'] 300 args += ['-R']
289 args += [local_path, remote_path] 301 args += [local_path, remote_path]
290 self.execute(args) 302 self.execute(args)
291 303
292 def cat(self, remote_path): 304 def cat(self, remote_path):
293 assert remote_path.startswith('gs://') 305 assert remote_path.startswith('gs://')
294 306
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
365 377
366 return checksum_filename 378 return checksum_filename
367 379
368 def GetChannelFromName(name): 380 def GetChannelFromName(name):
369 """Get the channel from the name. Bleeding edge builders don't 381 """Get the channel from the name. Bleeding edge builders don't
370 have a suffix.""" 382 have a suffix."""
371 channel_name = string.split(name, '-').pop() 383 channel_name = string.split(name, '-').pop()
372 if channel_name in Channel.ALL_CHANNELS: 384 if channel_name in Channel.ALL_CHANNELS:
373 return channel_name 385 return channel_name
374 return Channel.BLEEDING_EDGE 386 return Channel.BLEEDING_EDGE
OLDNEW
« no previous file with comments | « DEPS ('k') | tools/bots/dart_sdk.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698