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

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: remove comment, fix whitespace 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
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/gen-dartdocs/%s' % (self.bucket, revision)
ricow1 2015/06/11 15:51:50 Why don't you want to put this under channels?, I
keertip 2015/06/11 18:10:09 Done.
212
206 def docs_latestpath(self, revision): 213 def docs_latestpath(self, revision):
207 assert len('%s' % revision) > 0 214 assert len('%s' % revision) > 0
208 return '%s/channels/%s/latest.txt' % (self.bucket, self.channel) 215 return '%s/channels/%s/latest.txt' % (self.bucket, self.channel)
209 216
210 def run(command, env=None, shell=False, throw_on_error=True): 217 def run(command, env=None, shell=False, throw_on_error=True):
211 print "Running command: ", command 218 print "Running command: ", command
212 219
213 p = subprocess.Popen(command, stdout=subprocess.PIPE, 220 p = subprocess.Popen(command, stdout=subprocess.PIPE,
214 stderr=subprocess.PIPE, env=env, shell=shell) 221 stderr=subprocess.PIPE, env=env, shell=shell)
215 (stdout, stderr) = p.communicate() 222 (stdout, stderr) = p.communicate()
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
271 278
272 if GSUtil.GSUTIL_IS_SHELL_SCRIPT: 279 if GSUtil.GSUTIL_IS_SHELL_SCRIPT:
273 gsutil_command = [GSUtil.GSUTIL_PATH] 280 gsutil_command = [GSUtil.GSUTIL_PATH]
274 else: 281 else:
275 gsutil_command = [sys.executable, GSUtil.GSUTIL_PATH] 282 gsutil_command = [sys.executable, GSUtil.GSUTIL_PATH]
276 283
277 return run(gsutil_command + gsutil_args, env=env, 284 return run(gsutil_command + gsutil_args, env=env,
278 shell=(GSUtil.GSUTIL_IS_SHELL_SCRIPT and 285 shell=(GSUtil.GSUTIL_IS_SHELL_SCRIPT and
279 sys.platform == 'win32')) 286 sys.platform == 'win32'))
280 287
281 def upload(self, local_path, remote_path, recursive=False, public=False): 288 def upload(self, local_path, remote_path, recursive=False, public=False, multi thread=False):
ricow1 2015/06/11 15:51:49 long line
keertip 2015/06/11 18:10:09 Done.
282 assert remote_path.startswith('gs://') 289 assert remote_path.startswith('gs://')
283 290
284 args = ['cp'] 291 if multithread:
292 args = ['-m', 'cp']
293 else:
294 args = ['cp']
285 if public: 295 if public:
286 args += ['-a', 'public-read'] 296 args += ['-a', 'public-read']
287 if recursive: 297 if recursive:
288 args += ['-R'] 298 args += ['-R']
289 args += [local_path, remote_path] 299 args += [local_path, remote_path]
290 self.execute(args) 300 self.execute(args)
291 301
292 def cat(self, remote_path): 302 def cat(self, remote_path):
293 assert remote_path.startswith('gs://') 303 assert remote_path.startswith('gs://')
294 304
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
365 375
366 return checksum_filename 376 return checksum_filename
367 377
368 def GetChannelFromName(name): 378 def GetChannelFromName(name):
369 """Get the channel from the name. Bleeding edge builders don't 379 """Get the channel from the name. Bleeding edge builders don't
370 have a suffix.""" 380 have a suffix."""
371 channel_name = string.split(name, '-').pop() 381 channel_name = string.split(name, '-').pop()
372 if channel_name in Channel.ALL_CHANNELS: 382 if channel_name in Channel.ALL_CHANNELS:
373 return channel_name 383 return channel_name
374 return Channel.BLEEDING_EDGE 384 return Channel.BLEEDING_EDGE
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698