OLD | NEW |
1 # Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 # Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 # Use of this source code is governed by a BSD-style license that can be | 2 # Use of this source code is governed by a BSD-style license that can be |
3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
4 | 4 |
5 """Common utilities for all buildbot scripts that specifically don't rely | 5 """Common utilities for all buildbot scripts that specifically don't rely |
6 on having a full chromium checkout. | 6 on having a full chromium checkout. |
7 """ | 7 """ |
8 | 8 |
9 import os | 9 import os |
10 import subprocess | 10 import subprocess |
(...skipping 14 matching lines...) Expand all Loading... |
25 | 25 |
26 False means it is either running on a trybot, or a user's machine. | 26 False means it is either running on a trybot, or a user's machine. |
27 | 27 |
28 Trybot names: | 28 Trybot names: |
29 (win|mac|linux)_nacl_sdk | 29 (win|mac|linux)_nacl_sdk |
30 | 30 |
31 Build-only Trybot names: | 31 Build-only Trybot names: |
32 (win|mac|linux)_nacl_sdk_build | 32 (win|mac|linux)_nacl_sdk_build |
33 | 33 |
34 Builder names: | 34 Builder names: |
35 (windows|mac|linux)-sdk-multi(bionic)(rel)?""" | 35 (windows|mac|linux)-sdk-multi(rel)?""" |
36 bot = os.getenv('BUILDBOT_BUILDERNAME', '') | 36 bot = os.getenv('BUILDBOT_BUILDERNAME', '') |
37 return '-sdk-multi' in bot or '-sdk-bionic-multi' in bot | 37 return '-sdk-multi' in bot |
38 | 38 |
39 | 39 |
40 def ErrorExit(msg): | 40 def ErrorExit(msg): |
41 """Write and error to stderr, then exit with 1 signaling failure.""" | 41 """Write and error to stderr, then exit with 1 signaling failure.""" |
42 sys.stderr.write(str(msg) + '\n') | 42 sys.stderr.write(str(msg) + '\n') |
43 sys.exit(1) | 43 sys.exit(1) |
44 | 44 |
45 | 45 |
46 def Trace(msg): | 46 def Trace(msg): |
47 if verbose: | 47 if verbose: |
(...skipping 175 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
223 # Without shell=True the windows implementation of subprocess.call will not | 223 # Without shell=True the windows implementation of subprocess.call will not |
224 # search the PATH for the executable: http://bugs.python.org/issue8557 | 224 # search the PATH for the executable: http://bugs.python.org/issue8557 |
225 shell = getos.GetPlatform() == 'win' | 225 shell = getos.GetPlatform() == 'win' |
226 | 226 |
227 cmd = [GetGsutil(), 'cp', '-a', 'public-read', filename, full_dst] | 227 cmd = [GetGsutil(), 'cp', '-a', 'public-read', filename, full_dst] |
228 Run(cmd, shell=shell, cwd=cwd) | 228 Run(cmd, shell=shell, cwd=cwd) |
229 url = 'https://storage.googleapis.com/%s/%s' % (bucket_path, filename) | 229 url = 'https://storage.googleapis.com/%s/%s' % (bucket_path, filename) |
230 if step_link: | 230 if step_link: |
231 sys.stdout.flush() | 231 sys.stdout.flush() |
232 sys.stderr.write('@@@STEP_LINK@download@%s@@@\n' % url) | 232 sys.stderr.write('@@@STEP_LINK@download@%s@@@\n' % url) |
OLD | NEW |