Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Delta Between Two Patch Sets: sitescripts/extensions/bin/createNightlies.py

Issue 29349846: Issue 4337 - Don't use -k command line switch when creating Firefox builds (Closed)
Left Patch Set: Made the logic a bit simpler Created Aug. 16, 2016, 1:32 p.m.
Right Patch Set: Addressed nits Created Aug. 17, 2016, 10:13 a.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
Left: Side by side diff | Download
Right: Side by side diff | Download
« no previous file with change/comment | « no previous file | no next file » | no next file with change/comment »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
LEFTRIGHT
1 # This file is part of the Adblock Plus web scripts, 1 # This file is part of the Adblock Plus web scripts,
2 # Copyright (C) 2006-2016 Eyeo GmbH 2 # Copyright (C) 2006-2016 Eyeo GmbH
3 # 3 #
4 # Adblock Plus is free software: you can redistribute it and/or modify 4 # Adblock Plus is free software: you can redistribute it and/or modify
5 # it under the terms of the GNU General Public License version 3 as 5 # it under the terms of the GNU General Public License version 3 as
6 # published by the Free Software Foundation. 6 # published by the Free Software Foundation.
7 # 7 #
8 # Adblock Plus is distributed in the hope that it will be useful, 8 # Adblock Plus is distributed in the hope that it will be useful,
9 # but WITHOUT ANY WARRANTY; without even the implied warranty of 9 # but WITHOUT ANY WARRANTY; without even the implied warranty of
10 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 10 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
(...skipping 283 matching lines...) Expand 10 before | Expand all | Expand 10 after
294 self.updateURL = urlparse.urljoin(self.config.nightliesURL, self.basenam e + '/' + outputFile + '?update') 294 self.updateURL = urlparse.urljoin(self.config.nightliesURL, self.basenam e + '/' + outputFile + '?update')
295 295
296 if self.config.type == 'android': 296 if self.config.type == 'android':
297 apkFile = open(self.path, 'wb') 297 apkFile = open(self.path, 'wb')
298 298
299 try: 299 try:
300 try: 300 try:
301 port = get_config().get('extensions', 'androidBuildPort') 301 port = get_config().get('extensions', 'androidBuildPort')
302 except ConfigParser.NoOptionError: 302 except ConfigParser.NoOptionError:
303 port = '22' 303 port = '22'
304 buildCommand = ['ssh', '-p', port, get_config().get('extensions' , 'androidBuildHost')] 304 command = ['ssh', '-p', port, get_config().get('extensions', 'an droidBuildHost')]
305 buildCommand.extend(map(pipes.quote, [ 305 command.extend(map(pipes.quote, [
306 '/home/android/bin/makedebugbuild.py', '--revision', 306 '/home/android/bin/makedebugbuild.py', '--revision',
307 self.buildNum, '--version', self.version, '--stdout' 307 self.buildNum, '--version', self.version, '--stdout'
308 ])) 308 ]))
309 subprocess.check_call(buildCommand, stdout=apkFile, close_fds=Tr ue) 309 subprocess.check_call(command, stdout=apkFile, close_fds=True)
310 except: 310 except:
311 # clear broken output if any 311 # clear broken output if any
312 if os.path.exists(self.path): 312 if os.path.exists(self.path):
313 os.remove(self.path) 313 os.remove(self.path)
314 raise 314 raise
315 else: 315 else:
316 env = os.environ 316 env = os.environ
317 spiderMonkeyBinary = self.config.spiderMonkeyBinary 317 spiderMonkeyBinary = self.config.spiderMonkeyBinary
318 if spiderMonkeyBinary: 318 if spiderMonkeyBinary:
319 env = dict(env, SPIDERMONKEY_BINARY=spiderMonkeyBinary) 319 env = dict(env, SPIDERMONKEY_BINARY=spiderMonkeyBinary)
320 320
321 buildCommand = [os.path.join(self.tempdir, 'build.py'), 321 command = [os.path.join(self.tempdir, 'build.py'),
Sebastian Noack 2016/08/16 16:06:57 Nit: Is this variable also used somewhere else? Ot
Wladimir Palant 2016/08/17 10:13:53 Done.
322 '-t', self.config.type, 'build', '-b', self.buildNum] 322 '-t', self.config.type, 'build', '-b', self.buildNum]
323 if self.config.type != "gecko": 323 if self.config.type != 'gecko':
Sebastian Noack 2016/08/16 16:06:57 Nit: As per our coding style guide, and already do
Wladimir Palant 2016/08/17 10:13:53 Done.
324 buildCommand.extend(['-k', self.config.keyFile]) 324 command.extend(['-k', self.config.keyFile])
325 buildCommand.append(self.path) 325 command.append(self.path)
326 subprocess.check_call(buildCommand, env=env) 326 subprocess.check_call(command, env=env)
327 327
328 if not os.path.exists(self.path): 328 if not os.path.exists(self.path):
329 raise Exception("Build failed, output file hasn't been created") 329 raise Exception("Build failed, output file hasn't been created")
330 330
331 linkPath = os.path.join(baseDir, '00latest%s' % self.config.packageSuffi x) 331 linkPath = os.path.join(baseDir, '00latest%s' % self.config.packageSuffi x)
332 if hasattr(os, 'symlink'): 332 if hasattr(os, 'symlink'):
333 if os.path.exists(linkPath): 333 if os.path.exists(linkPath):
334 os.remove(linkPath) 334 os.remove(linkPath)
335 os.symlink(os.path.basename(self.path), linkPath) 335 os.symlink(os.path.basename(self.path), linkPath)
336 else: 336 else:
(...skipping 293 matching lines...) Expand 10 before | Expand all | Expand 10 after
630 except Exception, ex: 630 except Exception, ex:
631 logging.error('The build for %s failed:', repo) 631 logging.error('The build for %s failed:', repo)
632 logging.exception(ex) 632 logging.exception(ex)
633 633
634 file = open(nightlyConfigFile, 'wb') 634 file = open(nightlyConfigFile, 'wb')
635 nightlyConfig.write(file) 635 nightlyConfig.write(file)
636 636
637 637
638 if __name__ == '__main__': 638 if __name__ == '__main__':
639 main() 639 main()
LEFTRIGHT
« no previous file | no next file » | Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Toggle Comments ('s')

Powered by Google App Engine
This is Rietveld