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

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

Issue 11236012: Add script for pub buildbots. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Split reusable code out of pub buildbot script. Created 8 years, 2 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/bot.py » ('j') | tools/bots/bot.py » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 # Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file 1 # Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file
2 # for details. All rights reserved. Use of this source code is governed by a 2 # for details. All rights reserved. Use of this source code is governed by a
3 # BSD-style license that can be found in the LICENSE file. 3 # BSD-style license that can be found in the LICENSE file.
4 4
5 #!/usr/bin/python 5 #!/usr/bin/python
6 6
7 # Copyright (c) 2011 The Chromium Authors. All rights reserved. 7 # Copyright (c) 2011 The Chromium Authors. All rights reserved.
8 # Use of this source code is governed by a BSD-style license that can be 8 # Use of this source code is governed by a BSD-style license that can be
9 # found in the LICENSE file. 9 # found in the LICENSE file.
10 10
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after
89 89
90 args: 90 args:
91 srcpath - the location of the source code to build 91 srcpath - the location of the source code to build
92 mode - the mode release or debug 92 mode - the mode release or debug
93 version - the svn version of the currently checked out code 93 version - the svn version of the currently checked out code
94 ''' 94 '''
95 print 'ProcessTools' 95 print 'ProcessTools'
96 96
97 toolsBuildScript = os.path.join('.', 'editor', 'build', 'build.py') 97 toolsBuildScript = os.path.join('.', 'editor', 'build', 'build.py')
98 98
99 # TODO(devoncarew): should we move this into GetBuildInfo()? 99 # TODO(devoncarew): should we move this into GetBuildInfo()?
100 # get the latest changed revision from the current repository sub-tree 100 # get the latest changed revision from the current repository sub-tree
101 version = GetLatestChangedRevision() 101 version = GetLatestChangedRevision()
102 102
103 #TODO: debug statements to be removed in the future. 103 #TODO: debug statements to be removed in the future.
104 print "mode = " + mode 104 print "mode = " + mode
105 print "name = " + name 105 print "name = " + name
106 print "version = " + version 106 print "version = " + version
107 print "toolsBuildScript = " + os.path.abspath(toolsBuildScript) 107 print "toolsBuildScript = " + os.path.abspath(toolsBuildScript)
108 108
109 utils = GetUtils() 109 utils = GetUtils()
(...skipping 17 matching lines...) Expand all
127 print 'ProcessCompiler' 127 print 'ProcessCompiler'
128 has_shell=False 128 has_shell=False
129 if 'windows' in name: 129 if 'windows' in name:
130 # In Windows we need to run in the shell, so that we have all the 130 # In Windows we need to run in the shell, so that we have all the
131 # environment variables available. 131 # environment variables available.
132 has_shell=True 132 has_shell=True
133 return subprocess.call([sys.executable, 133 return subprocess.call([sys.executable,
134 os.path.join('utils', 'compiler', 'buildbot.py')], 134 os.path.join('utils', 'compiler', 'buildbot.py')],
135 env=os.environ, shell=has_shell) 135 env=os.environ, shell=has_shell)
136 136
137 def ProcessPub(name):
138 '''
139 Build and test pub and the pub packages in the main Dart repository.
140 '''
ricow1 2012/10/22 06:29:05 maybe replicate the print from the other Process*
Bob Nystrom 2012/10/23 22:27:20 Done.
141 has_shell=False
142 if '-win' in name:
143 # In Windows we need to run in the shell, so that we have all the
144 # environment variables available.
145 has_shell=True
146 return subprocess.call([sys.executable,
147 os.path.join('tools', 'bots', 'pub.py')],
148 env=os.environ, shell=has_shell)
149
137 def FixJavaHome(): 150 def FixJavaHome():
138 buildbot_javahome = os.getenv('BUILDBOT_JAVA_HOME') 151 buildbot_javahome = os.getenv('BUILDBOT_JAVA_HOME')
139 if buildbot_javahome: 152 if buildbot_javahome:
140 current_pwd = os.getenv('PWD') 153 current_pwd = os.getenv('PWD')
141 java_home = os.path.join(current_pwd, buildbot_javahome) 154 java_home = os.path.join(current_pwd, buildbot_javahome)
142 os.environ['JAVA_HOME'] = java_home 155 os.environ['JAVA_HOME'] = java_home
143 print 'Setting java home to' 156 print 'Setting java home to'
144 print java_home 157 print java_home
145 158
146 def ClobberBuilder(): 159 def ClobberBuilder():
147 """ Clobber the builder before we do the build. 160 """ Clobber the builder before we do the build.
148 Args: 161 Args:
149 - mode: either 'debug' or 'release' 162 - mode: either 'debug' or 'release'
150 """ 163 """
151 cmd = [sys.executable, 164 cmd = [sys.executable,
152 './tools/clean_output_directory.py'] 165 './tools/clean_output_directory.py']
153 print 'Clobbering %s' % (' '.join(cmd)) 166 print 'Clobbering %s' % (' '.join(cmd))
154 return subprocess.call(cmd) 167 return subprocess.call(cmd)
155 168
156 def GetShouldClobber(): 169 def GetShouldClobber():
157 return os.environ.get(BUILDER_CLOBBER) == "1" 170 return os.environ.get(BUILDER_CLOBBER) == "1"
158 171
159 def RunDart(scriptPath): 172 def RunDart(scriptPath):
160 if sys.platform == 'darwin': 173 if sys.platform == 'darwin':
161 pipe = subprocess.Popen( 174 pipe = subprocess.Popen(
162 ['./tools/testing/bin/macos/dart', scriptPath], 175 ['./tools/testing/bin/macos/dart', scriptPath],
163 stdout=subprocess.PIPE, stderr=subprocess.PIPE) 176 stdout=subprocess.PIPE, stderr=subprocess.PIPE)
164 elif os.name == 'posix': 177 elif os.name == 'posix':
165 pipe = subprocess.Popen( 178 pipe = subprocess.Popen(
166 ['./tools/testing/bin/linux/dart', scriptPath], 179 ['./tools/testing/bin/linux/dart', scriptPath],
167 stdout=subprocess.PIPE, stderr=subprocess.PIPE) 180 stdout=subprocess.PIPE, stderr=subprocess.PIPE)
168 else: 181 else:
169 pipe = subprocess.Popen( 182 pipe = subprocess.Popen(
170 ['tools\\testing\\bin\\windows\\dart.exe', scriptPath], 183 ['tools\\testing\\bin\\windows\\dart.exe', scriptPath],
171 stdout=subprocess.PIPE, stderr=subprocess.PIPE, shell=True) 184 stdout=subprocess.PIPE, stderr=subprocess.PIPE, shell=True)
172 185
173 output = pipe.communicate() 186 output = pipe.communicate()
174 return output[0] 187 return output[0]
175 188
176 def GetLatestChangedRevision(): 189 def GetLatestChangedRevision():
177 # 0.1.2.0_r13661 190 # 0.1.2.0_r13661
178 # 0.1.2.0_r13661_username 191 # 0.1.2.0_r13661_username
179 fullVersion = RunDart("tools/version.dart") 192 fullVersion = RunDart("tools/version.dart")
180 193
(...skipping 20 matching lines...) Expand all
201 print '@@@STEP_FAILURE@@@' 214 print '@@@STEP_FAILURE@@@'
202 return status 215 return status
203 216
204 217
205 #TODO(sigmund): remove this indirection once we update our bots 218 #TODO(sigmund): remove this indirection once we update our bots
206 (name, version) = GetBuildInfo() 219 (name, version) = GetBuildInfo()
207 if name.startswith('dart-editor'): 220 if name.startswith('dart-editor'):
208 # TODO (danrubel) Fix dart-editor builds so that we can call FixJavaHome() b efore the build 221 # TODO (danrubel) Fix dart-editor builds so that we can call FixJavaHome() b efore the build
209 FixJavaHome() 222 FixJavaHome()
210 status = ProcessTools('release', name, version) 223 status = ProcessTools('release', name, version)
224 elif name.startswith('pub-'):
225 status = ProcessPub(name)
211 else: 226 else:
212 # The buildbot will set a BUILDBOT_JAVA_HOME relative to the dart 227 # The buildbot will set a BUILDBOT_JAVA_HOME relative to the dart
213 # root directory, set JAVA_HOME based on that. 228 # root directory, set JAVA_HOME based on that.
214 FixJavaHome() 229 FixJavaHome()
215 status = ProcessCompiler(name) 230 status = ProcessCompiler(name)
216 231
217 if status: 232 if status:
218 print '@@@STEP_FAILURE@@@' 233 print '@@@STEP_FAILURE@@@'
219 234
220 return status 235 return status
221 236
222 237
223 if __name__ == '__main__': 238 if __name__ == '__main__':
224 sys.exit(main()) 239 sys.exit(main())
OLDNEW
« no previous file with comments | « no previous file | tools/bots/bot.py » ('j') | tools/bots/bot.py » ('J')

Powered by Google App Engine
This is Rietveld 408576698