OLD | NEW |
1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
2 # Copyright (c) 2012 The Chromium Authors. All rights reserved. | 2 # Copyright (c) 2012 The Chromium Authors. All rights reserved. |
3 # Use of this source code is governed by a BSD-style license that can be | 3 # Use of this source code is governed by a BSD-style license that can be |
4 # found in the LICENSE file. | 4 # found in the LICENSE file. |
5 | 5 |
6 """Common utilities for all buildbot scripts that specifically don't rely | 6 """Common utilities for all buildbot scripts that specifically don't rely |
7 on having a full chromium checkout. | 7 on having a full chromium checkout. |
8 """ | 8 """ |
9 | 9 |
10 import os | 10 import os |
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
90 LOCAL_GSUTIL = 'gsutil' | 90 LOCAL_GSUTIL = 'gsutil' |
91 | 91 |
92 | 92 |
93 def GetGsutil(): | 93 def GetGsutil(): |
94 if os.environ.get('BUILDBOT_BUILDERNAME'): | 94 if os.environ.get('BUILDBOT_BUILDERNAME'): |
95 return BOT_GSUTIL | 95 return BOT_GSUTIL |
96 else: | 96 else: |
97 return LOCAL_GSUTIL | 97 return LOCAL_GSUTIL |
98 | 98 |
99 | 99 |
100 def Archive(filename, bucket_path, cwd=None): | 100 def Archive(filename, bucket_path, cwd=None, step_link=True): |
101 """Upload the given filename to Google Store.""" | 101 """Upload the given filename to Google Store.""" |
102 full_dst = 'gs://%s/%s' % (bucket_path, filename) | 102 full_dst = 'gs://%s/%s' % (bucket_path, filename) |
103 | 103 |
104 subprocess.check_call( | 104 subprocess.check_call( |
105 '%s cp -a public-read %s %s' % (GetGsutil(), filename, full_dst), | 105 '%s cp -a public-read %s %s' % (GetGsutil(), filename, full_dst), |
106 shell=True, | 106 shell=True, |
107 cwd=cwd) | 107 cwd=cwd) |
108 url = 'https://commondatastorage.googleapis.com/'\ | 108 url = 'https://commondatastorage.googleapis.com/'\ |
109 '%s/%s' % (bucket_path, filename) | 109 '%s/%s' % (bucket_path, filename) |
110 print '@@@STEP_LINK@download@%s@@@' % url | 110 if step_link: |
111 sys.stdout.flush() | 111 print '@@@STEP_LINK@download@%s@@@' % url |
| 112 sys.stdout.flush() |
OLD | NEW |