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

Side by Side Diff: client/tools/buildbot_annotated_steps.py

Issue 16968005: Also remove chromium specific boto config for cross-vm environment (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 6 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 | 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/python 1 #!/usr/bin/python
2 # Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file 2 # Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file
3 # for details. All rights reserved. Use of this source code is governed by a 3 # for details. All rights reserved. Use of this source code is governed by a
4 # BSD-style license that can be found in the LICENSE file. 4 # BSD-style license that can be found in the LICENSE file.
5 5
6 # Copyright (c) 2011 The Chromium Authors. All rights reserved. 6 # Copyright (c) 2011 The Chromium Authors. All rights reserved.
7 # Use of this source code is governed by a BSD-style license that can be 7 # Use of this source code is governed by a BSD-style license that can be
8 # found in the LICENSE file. 8 # found in the LICENSE file.
9 9
10 """Dart client buildbot steps 10 """Dart client buildbot steps
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after
97 97
98 # TODO(devoncarew): should we move this into GetBuildInfo()? 98 # TODO(devoncarew): should we move this into GetBuildInfo()?
99 # get the latest changed revision from the current repository sub-tree 99 # get the latest changed revision from the current repository sub-tree
100 version = GetLatestChangedRevision() 100 version = GetLatestChangedRevision()
101 101
102 utils = GetUtils() 102 utils = GetUtils()
103 outdir = GetOutDir(utils, mode) 103 outdir = GetOutDir(utils, mode)
104 cmds = [sys.executable, toolsBuildScript, 104 cmds = [sys.executable, toolsBuildScript,
105 '--mode=' + mode, '--revision=' + version, 105 '--mode=' + mode, '--revision=' + version,
106 '--name=' + name, '--out=' + outdir] 106 '--name=' + name, '--out=' + outdir]
107 local_env = os.environ.copy() 107 local_env = EnvironmentWithoutBotoConfig()
108 # The buildbot sets AWS_CREDENTIAL_FILE/BOTO_CONFIG to the chromium specific
109 # file, we use the one in home.
110 if 'BOTO_CONFIG' in local_env:
111 del local_env['BOTO_CONFIG']
112 if 'AWS_CREDENTIAL_FILE' in local_env:
113 del local_env['AWS_CREDENTIAL_FILE']
114 #if 'linux' in name: 108 #if 'linux' in name:
115 # javahome = os.path.join(os.path.expanduser('~'), 'jdk1.6.0_25') 109 # javahome = os.path.join(os.path.expanduser('~'), 'jdk1.6.0_25')
116 # local_env['JAVA_HOME'] = javahome 110 # local_env['JAVA_HOME'] = javahome
117 # local_env['PATH'] = (os.path.join(javahome, 'bin') + 111 # local_env['PATH'] = (os.path.join(javahome, 'bin') +
118 # os.pathsep + local_env['PATH']) 112 # os.pathsep + local_env['PATH'])
119 113
120 return subprocess.call(cmds, env=local_env) 114 return subprocess.call(cmds, env=local_env)
121 115
122 def ProcessBot(name, target): 116 def EnvironmentWithoutBotoConfig(environment=None):
117 # The buildbot sets AWS_CREDENTIAL_FILE/BOTO_CONFIG to the chromium specific
118 # file, we use the one in home.
119 custom_env = dict(environment or os.environ)
120 if 'BOTO_CONFIG' in custom_env:
121 del custom_env['BOTO_CONFIG']
122 if 'AWS_CREDENTIAL_FILE' in custom_env:
123 del custom_env['AWS_CREDENTIAL_FILE']
124 return custom_env
125
126 def ProcessBot(name, target, custom_env=None):
123 ''' 127 '''
124 Build and test the named bot target (compiler, android, pub). We look for 128 Build and test the named bot target (compiler, android, pub). We look for
125 the supporting script in tools/bots/ to run the tests and build. 129 the supporting script in tools/bots/ to run the tests and build.
126 ''' 130 '''
127 print 'Process%s' % target.capitalize() 131 print 'Process%s' % target.capitalize()
128 has_shell=False 132 has_shell = False
133 environment = custom_env or os.environ
129 if '-win' in name: 134 if '-win' in name:
130 # In Windows we need to run in the shell, so that we have all the 135 # In Windows we need to run in the shell, so that we have all the
131 # environment variables available. 136 # environment variables available.
132 has_shell=True 137 has_shell = True
133 return subprocess.call([sys.executable, 138 return subprocess.call([sys.executable,
134 os.path.join('tools', 'bots', target + '.py')], 139 os.path.join('tools', 'bots', target + '.py')],
135 env=os.environ, shell=has_shell) 140 env=environment, shell=has_shell)
136 141
137 def FixJavaHome(): 142 def FixJavaHome():
138 buildbot_javahome = os.getenv('BUILDBOT_JAVA_HOME') 143 buildbot_javahome = os.getenv('BUILDBOT_JAVA_HOME')
139 if buildbot_javahome: 144 if buildbot_javahome:
140 current_pwd = os.getenv('PWD') 145 current_pwd = os.getenv('PWD')
141 java_home = os.path.join(current_pwd, buildbot_javahome) 146 java_home = os.path.join(current_pwd, buildbot_javahome)
142 java_bin = os.path.join(java_home, 'bin') 147 java_bin = os.path.join(java_home, 'bin')
143 os.environ['JAVA_HOME'] = java_home 148 os.environ['JAVA_HOME'] = java_home
144 os.environ['PATH'] = '%s;%s' % (java_bin, os.environ['PATH']) 149 os.environ['PATH'] = '%s;%s' % (java_bin, os.environ['PATH'])
145 150
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
215 # In case we're an FYI builder, run 'tools/bots/editor.py'. 220 # In case we're an FYI builder, run 'tools/bots/editor.py'.
216 status = ProcessBot(name, 'editor') 221 status = ProcessBot(name, 'editor')
217 else: 222 else:
218 # Run the old annotated steps script 223 # Run the old annotated steps script
219 status = ProcessTools('release', name, version) 224 status = ProcessTools('release', name, version)
220 elif name.startswith('pub-'): 225 elif name.startswith('pub-'):
221 status = ProcessBot(name, 'pub') 226 status = ProcessBot(name, 'pub')
222 elif name.startswith('vm-android'): 227 elif name.startswith('vm-android'):
223 status = ProcessBot(name, 'android') 228 status = ProcessBot(name, 'android')
224 elif name.startswith('cross') or name.startswith('target'): 229 elif name.startswith('cross') or name.startswith('target'):
225 status = ProcessBot(name, 'cross-vm') 230 status = ProcessBot(name, 'cross-vm',
231 custom_env=EnvironmentWithoutBotoConfig())
226 else: 232 else:
227 status = ProcessBot(name, 'compiler') 233 status = ProcessBot(name, 'compiler')
228 234
229 if status: 235 if status:
230 print '@@@STEP_FAILURE@@@' 236 print '@@@STEP_FAILURE@@@'
231 237
232 return status 238 return status
233 239
234 240
235 if __name__ == '__main__': 241 if __name__ == '__main__':
236 sys.exit(main()) 242 sys.exit(main())
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