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: Created Aug. 16, 2016, 10:02 a.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 if self.config.type == "gecko": 321 command = [os.path.join(self.tempdir, 'build.py'),
322 key_params = [] 322 '-t', self.config.type, 'build', '-b', self.buildNum]
323 else: 323 if self.config.type != 'gecko':
324 key_params = ['-k', self.config.keyFile] 324 command.extend(['-k', self.config.keyFile])
325 325 command.append(self.path)
326 buildCommand = ([os.path.join(self.tempdir, 'build.py'), 326 subprocess.check_call(command, env=env)
Sebastian Noack 2016/08/16 12:27:54 I think it's a little simpler and more readable if
Wladimir Palant 2016/08/16 13:33:09 Done.
327 '-t', self.config.type, 'build', '-b', self.buildNum] +
328 key_params + [self.path])
329 subprocess.check_call(buildCommand, env=env)
330 327
331 if not os.path.exists(self.path): 328 if not os.path.exists(self.path):
332 raise Exception("Build failed, output file hasn't been created") 329 raise Exception("Build failed, output file hasn't been created")
333 330
334 linkPath = os.path.join(baseDir, '00latest%s' % self.config.packageSuffi x) 331 linkPath = os.path.join(baseDir, '00latest%s' % self.config.packageSuffi x)
335 if hasattr(os, 'symlink'): 332 if hasattr(os, 'symlink'):
336 if os.path.exists(linkPath): 333 if os.path.exists(linkPath):
337 os.remove(linkPath) 334 os.remove(linkPath)
338 os.symlink(os.path.basename(self.path), linkPath) 335 os.symlink(os.path.basename(self.path), linkPath)
339 else: 336 else:
(...skipping 293 matching lines...) Expand 10 before | Expand all | Expand 10 after
633 except Exception, ex: 630 except Exception, ex:
634 logging.error('The build for %s failed:', repo) 631 logging.error('The build for %s failed:', repo)
635 logging.exception(ex) 632 logging.exception(ex)
636 633
637 file = open(nightlyConfigFile, 'wb') 634 file = open(nightlyConfigFile, 'wb')
638 nightlyConfig.write(file) 635 nightlyConfig.write(file)
639 636
640 637
641 if __name__ == '__main__': 638 if __name__ == '__main__':
642 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