OLD | NEW |
---|---|
1 #!/usr/bin/python | 1 #!/usr/bin/python |
2 | 2 |
3 """Copyright (c) 2011 The Chromium Authors. All rights reserved. | 3 """Copyright (c) 2011 The Chromium Authors. All rights reserved. |
4 | 4 |
5 Use of this source code is governed by a BSD-style license that can be | 5 Use of this source code is governed by a BSD-style license that can be |
6 found in the LICENSE file. | 6 found in the LICENSE file. |
7 | 7 |
8 Eclipse Dart Editor buildbot steps. | 8 Eclipse Dart Editor buildbot steps. |
9 """ | 9 """ |
10 | 10 |
(...skipping 221 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
232 # 'USERNAME' Windows were used. | 232 # 'USERNAME' Windows were used. |
233 username = os.environ.get('USER') | 233 username = os.environ.get('USER') |
234 if username is None: | 234 if username is None: |
235 username = os.environ.get('USERNAME') | 235 username = os.environ.get('USERNAME') |
236 | 236 |
237 if username is None: | 237 if username is None: |
238 _PrintError('could not find the user name' | 238 _PrintError('could not find the user name' |
239 ' tried environment variables' | 239 ' tried environment variables' |
240 ' USER and USERNAME') | 240 ' USER and USERNAME') |
241 return 1 | 241 return 1 |
242 sdk_environment = os.environ | |
242 if username.startswith('chrome'): | 243 if username.startswith('chrome'): |
243 to_bucket = 'gs://dart-editor-archive-continuous' | 244 to_bucket = 'gs://dart-editor-archive-continuous' |
245 from_bucket = 'gs://dart-dump-render-tree' | |
244 else: | 246 else: |
245 to_bucket = 'gs://dart-editor-archive-testing' | 247 to_bucket = 'gs://dart-editor-archive-testing' |
248 from_bucket = 'gs://dart-editor-archive-testing' | |
danrubel
2011/12/12 20:34:53
In this case, lets skip the copy completely
Mark R Russell
2011/12/12 22:01:52
Done.
| |
249 sdk_environment['DART_LOCAL_BUILD'] = 'dart-editor-archive-testing' | |
246 | 250 |
247 print '@@@BUILD_STEP dart-ide dart clients: %s@@@' % options.name | 251 print '@@@BUILD_STEP dart-ide dart clients: %s@@@' % options.name |
252 print 'JAVA_HOME = {0}'.format(str(sdk_environment['JAVA_HOME'])) | |
248 builder_name = str(options.name) | 253 builder_name = str(options.name) |
249 | 254 |
250 if builder_name != 'dart-editor-win' and builder_name != 'dart-editor': | 255 if builder_name != 'dart-editor-win' and builder_name != 'dart-editor': |
251 _PrintSeparator('running the build of the Dart SDK') | 256 _PrintSeparator('running the build of the Dart SDK') |
252 dartbuildscript = os.path.join(toolspath, 'build.py') | 257 dartbuildscript = os.path.join(toolspath, 'build.py') |
253 cmds = [sys.executable, dartbuildscript, | 258 cmds = [sys.executable, dartbuildscript, |
254 '--mode=release', 'upload_sdk'] | 259 '--mode=release', 'upload_sdk'] |
255 cwd = os.getcwd() | 260 cwd = os.getcwd() |
256 try: | 261 try: |
257 os.chdir(dartpath) | 262 os.chdir(dartpath) |
258 print ' '.join(cmds) | 263 print ' '.join(cmds) |
259 status = subprocess.call(cmds) | 264 status = subprocess.call(cmds, env=sdk_environment) |
260 print 'sdk build returned ' + str(status) | 265 print 'sdk build returned ' + str(status) |
261 if status: | 266 if status: |
262 _PrintError('the build of the SDK failed') | 267 _PrintError('the build of the SDK failed') |
263 return status | 268 return status |
264 finally: | 269 finally: |
265 os.chdir(cwd) | 270 os.chdir(cwd) |
266 | 271 |
267 _CopySdk(buildos, revision, to_bucket, gsu) | 272 _CopySdk(buildos, revision, to_bucket, from_bucket, gsu) |
268 | 273 |
269 if builder_name == 'dart-editor': | 274 if builder_name == 'dart-editor': |
270 buildos = None | 275 buildos = None |
271 else: | 276 else: |
272 _PrintSeparator('new builder running on {0} is' | 277 _PrintSeparator('new builder running on {0} is' |
273 ' a place holder until the os specific builds' | 278 ' a place holder until the os specific builds' |
274 ' are in place. This is a ' | 279 ' are in place. This is a ' |
275 'normal termination'.format(builder_name)) | 280 'normal termination'.format(builder_name)) |
276 return 0 | 281 return 0 |
277 | 282 |
(...skipping 187 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
465 for element in contents: | 470 for element in contents: |
466 for tag in bucket_tags: | 471 for tag in bucket_tags: |
467 if tag in element: | 472 if tag in element: |
468 print 'setting ACL on {0}'.format(element) | 473 print 'setting ACL on {0}'.format(element) |
469 gsu.SetCannedAcl(element, 'project-private') | 474 gsu.SetCannedAcl(element, 'project-private') |
470 acl = gsu.GetAcl(element) | 475 acl = gsu.GetAcl(element) |
471 acl = gsu.AddPublicAcl(acl) | 476 acl = gsu.AddPublicAcl(acl) |
472 gsu.SetAcl(element, acl) | 477 gsu.SetAcl(element, acl) |
473 | 478 |
474 | 479 |
475 def _CopySdk(buildos, revision, bucket, gsu): | 480 def _CopySdk(buildos, revision, bucket_to, bucket_from, gsu): |
476 """copy the deployed SDK to the editor buckets. | 481 """copy the deployed SDK to the editor buckets. |
477 | 482 |
478 Args: | 483 Args: |
479 buildos: the OS the build is running under | 484 buildos: the OS the build is running under |
480 revision: the svn revision | 485 revision: the svn revision |
481 bucket: the bucket to upload to | 486 bucket_to: the bucket to upload to |
487 bucket_from: the bucket to copy from | |
482 gsu: the gsutil object | 488 gsu: the gsutil object |
483 """ | 489 """ |
484 print '_CopySdk({0}, {1}, gsu)'.format(buildos, revision) | 490 print '_CopySdk({0}, {1}, gsu)'.format(buildos, revision) |
485 gszip = 'dart-{0}-{1}.zip'.format(buildos, revision) | 491 gszip = 'dart-{0}-{1}.zip'.format(buildos, revision) |
486 gssdkzip = 'gs://dart-dump-render-tree/sdk/{0}'.format(gszip) | 492 gssdkzip = 'gs://dart-dump-render-tree/sdk/{0}'.format(gszip) |
487 gseditorzip = '{0}/{1}/{2}'.format(bucket, revision, gszip) | 493 gseditorzip = '{0}/{1}/{2}'.format(bucket_to, revision, gszip) |
488 gseditorlatestzip = '{0}/{1}/{2}'.format(bucket, 'latest', gszip) | 494 gseditorlatestzip = '{0}/{1}/{2}'.format(bucket_to, 'latest', gszip) |
489 | 495 |
490 print 'copying {0} to {1}'.format(gssdkzip, gseditorzip) | 496 print 'copying {0} to {1}'.format(gssdkzip, gseditorzip) |
491 gsu.Copy(gssdkzip, gseditorzip) | 497 gsu.Copy(gssdkzip, gseditorzip) |
492 print 'copying {0} to {1}'.format(gssdkzip, gseditorlatestzip) | 498 print 'copying {0} to {1}'.format(gssdkzip, gseditorlatestzip) |
493 gsu.Copy(gssdkzip, gseditorlatestzip) | 499 gsu.Copy(gssdkzip, gseditorlatestzip) |
494 _SetAclOnArtifacts(bucket, [gszip], gsu) | 500 _SetAclOnArtifacts(bucket_to, [gszip], gsu) |
495 | 501 |
496 | 502 |
497 def _PrintSeparator(text): | 503 def _PrintSeparator(text): |
498 """Print a separator for the build steps.""" | 504 """Print a separator for the build steps.""" |
499 | 505 |
500 #used to print separators during the build process | 506 #used to print separators during the build process |
501 tag_line_sep = '================================' | 507 tag_line_sep = '================================' |
502 tag_line_text = '= {0}' | 508 tag_line_text = '= {0}' |
503 | 509 |
504 print tag_line_sep | 510 print tag_line_sep |
(...skipping 10 matching lines...) Expand all Loading... | |
515 | 521 |
516 print error_sep | 522 print error_sep |
517 print error_sep | 523 print error_sep |
518 print error_text.format(text) | 524 print error_text.format(text) |
519 print error_sep | 525 print error_sep |
520 print error_sep | 526 print error_sep |
521 | 527 |
522 | 528 |
523 if __name__ == '__main__': | 529 if __name__ == '__main__': |
524 sys.exit(main()) | 530 sys.exit(main()) |
OLD | NEW |