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

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

Issue 1647293002: on gcs, move docs for be to builds dir, and dev & stable to dev/stable (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Created 4 years, 10 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 | « no previous file | no next file » | 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 181 matching lines...) Expand 10 before | Expand all | Expand 10 after
192 return '%s-%s-%s-%s.zip' % ( 192 return '%s-%s-%s-%s.zip' % (
193 name, SYSTEM_RENAMES[system], ARCH_RENAMES[arch], mode) 193 name, SYSTEM_RENAMES[system], ARCH_RENAMES[arch], mode)
194 194
195 class GCSNamerApiDocs(object): 195 class GCSNamerApiDocs(object):
196 def __init__(self, channel=Channel.BLEEDING_EDGE): 196 def __init__(self, channel=Channel.BLEEDING_EDGE):
197 assert channel in Channel.ALL_CHANNELS 197 assert channel in Channel.ALL_CHANNELS
198 198
199 self.channel = channel 199 self.channel = channel
200 self.bucket = 'gs://dartlang-api-docs' 200 self.bucket = 'gs://dartlang-api-docs'
201 201
202 def docs_dirpath(self, revision):
203 assert len('%s' % revision) > 0
204 return '%s/channels/%s/%s' % (self.bucket, self.channel, revision)
205
206 def dartdocs_dirpath(self, revision): 202 def dartdocs_dirpath(self, revision):
207 assert len('%s' % revision) > 0 203 assert len('%s' % revision) > 0
208 return '%s/gen-dartdocs/%s' % (self.bucket, revision) 204 if self.channel == Channel.BLEEDING_EDGE:
205 return '%s/gen-dartdocs/builds/%s' % (self.bucket, revision)
206 return '%s/gen-dartdocs/%s/%s' % (self.bucket, self.channel, revision)
209 207
210 def docs_latestpath(self, revision): 208 def docs_latestpath(self, revision):
211 assert len('%s' % revision) > 0 209 assert len('%s' % revision) > 0
212 return '%s/channels/%s/latest.txt' % (self.bucket, self.channel) 210 return '%s/channels/%s/latest.txt' % (self.bucket, self.channel)
213 211
214 def run(command, env=None, shell=False, throw_on_error=True): 212 def run(command, env=None, shell=False, throw_on_error=True):
215 print "Running command: ", command 213 print "Running command: ", command
216 214
217 p = subprocess.Popen(command, stdout=subprocess.PIPE, 215 p = subprocess.Popen(command, stdout=subprocess.PIPE,
218 stderr=subprocess.PIPE, env=env, shell=shell) 216 stderr=subprocess.PIPE, env=env, shell=shell)
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after
360 358
361 return checksum_filename 359 return checksum_filename
362 360
363 def GetChannelFromName(name): 361 def GetChannelFromName(name):
364 """Get the channel from the name. Bleeding edge builders don't 362 """Get the channel from the name. Bleeding edge builders don't
365 have a suffix.""" 363 have a suffix."""
366 channel_name = string.split(name, '-').pop() 364 channel_name = string.split(name, '-').pop()
367 if channel_name in Channel.ALL_CHANNELS: 365 if channel_name in Channel.ALL_CHANNELS:
368 return channel_name 366 return channel_name
369 return Channel.BLEEDING_EDGE 367 return Channel.BLEEDING_EDGE
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698