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

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

Issue 261283002: Add annotated steps script for validating that the version on dev and stable is always increasing w… (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 6 years, 7 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | tools/bots/version_checker.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 string 10 import string
(...skipping 246 matching lines...) Expand 10 before | Expand all | Expand 10 after
257 'win32': r'e:\b\build\site_config\.boto', 257 'win32': r'e:\b\build\site_config\.boto',
258 }[utils.GuessOS()] 258 }[utils.GuessOS()]
259 env['AWS_CREDENTIAL_FILE'] = boto_config 259 env['AWS_CREDENTIAL_FILE'] = boto_config
260 env['BOTO_CONFIG'] = boto_config 260 env['BOTO_CONFIG'] = boto_config
261 261
262 if GSUtil.GSUTIL_IS_SHELL_SCRIPT: 262 if GSUtil.GSUTIL_IS_SHELL_SCRIPT:
263 gsutil_command = [GSUtil.GSUTIL_PATH] 263 gsutil_command = [GSUtil.GSUTIL_PATH]
264 else: 264 else:
265 gsutil_command = [sys.executable, GSUtil.GSUTIL_PATH] 265 gsutil_command = [sys.executable, GSUtil.GSUTIL_PATH]
266 266
267 run(gsutil_command + gsutil_args, env=env, 267 return run(gsutil_command + gsutil_args, env=env,
268 shell=(GSUtil.GSUTIL_IS_SHELL_SCRIPT and sys.platform == 'win32')) 268 shell=(GSUtil.GSUTIL_IS_SHELL_SCRIPT and
269 sys.platform == 'win32'))
269 270
270 def upload(self, local_path, remote_path, recursive=False, public=False): 271 def upload(self, local_path, remote_path, recursive=False, public=False):
271 assert remote_path.startswith('gs://') 272 assert remote_path.startswith('gs://')
272 273
273 args = ['cp'] 274 args = ['cp']
274 if public: 275 if public:
275 args += ['-a', 'public-read'] 276 args += ['-a', 'public-read']
276 if recursive: 277 if recursive:
277 args += ['-R'] 278 args += ['-R']
278 args += [local_path, remote_path] 279 args += [local_path, remote_path]
279 self.execute(args) 280 self.execute(args)
280 281
282 def cat(self, remote_path):
283 assert remote_path.startswith('gs://')
284
285 args = ['cat', remote_path]
286 (stdout, _, _) = self.execute(args)
287 return stdout
288
281 def setGroupReadACL(self, remote_path, group): 289 def setGroupReadACL(self, remote_path, group):
282 args = ['acl', 'ch', '-g', '%s:R' % group, remote_path] 290 args = ['acl', 'ch', '-g', '%s:R' % group, remote_path]
283 self.execute(args) 291 self.execute(args)
284 292
285 def setContentType(self, remote_path, content_type): 293 def setContentType(self, remote_path, content_type):
286 args = ['setmeta', '-h', 'Content-Type:%s' % content_type, remote_path] 294 args = ['setmeta', '-h', 'Content-Type:%s' % content_type, remote_path]
287 self.execute(args) 295 self.execute(args)
288 296
289 def remove(self, remote_path, recursive=False): 297 def remove(self, remote_path, recursive=False):
290 assert remote_path.startswith('gs://') 298 assert remote_path.startswith('gs://')
(...skipping 30 matching lines...) Expand all
321 329
322 return checksum_filename 330 return checksum_filename
323 331
324 def GetChannelFromName(name): 332 def GetChannelFromName(name):
325 """Get the channel from the name. Bleeding edge builders don't 333 """Get the channel from the name. Bleeding edge builders don't
326 have a suffix.""" 334 have a suffix."""
327 channel_name = string.split(name, '-').pop() 335 channel_name = string.split(name, '-').pop()
328 if channel_name in Channel.ALL_CHANNELS: 336 if channel_name in Channel.ALL_CHANNELS:
329 return channel_name 337 return channel_name
330 return Channel.BLEEDING_EDGE 338 return Channel.BLEEDING_EDGE
OLDNEW
« no previous file with comments | « no previous file | tools/bots/version_checker.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698