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

Side by Side Diff: sitescripts/extensions/bin/createNightlies.py

Issue 29322523: Issue 2796 - Moved logic to extract Safari Developer ID to buildtools (Closed)
Patch Set: Created July 16, 2015, 3:14 p.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | sitescripts/extensions/bin/updateUpdateManifests.py » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 # coding: utf-8 1 # coding: utf-8
2 2
3 # This file is part of the Adblock Plus web scripts, 3 # This file is part of the Adblock Plus web scripts,
4 # Copyright (C) 2006-2015 Eyeo GmbH 4 # Copyright (C) 2006-2015 Eyeo GmbH
5 # 5 #
6 # Adblock Plus is free software: you can redistribute it and/or modify 6 # Adblock Plus is free software: you can redistribute it and/or modify
7 # it under the terms of the GNU General Public License version 3 as 7 # it under the terms of the GNU General Public License version 3 as
8 # published by the Free Software Foundation. 8 # published by the Free Software Foundation.
9 # 9 #
10 # Adblock Plus is distributed in the hope that it will be useful, 10 # Adblock Plus is distributed in the hope that it will be useful,
(...skipping 13 matching lines...) Expand all
24 with changelogs and documentation. 24 with changelogs and documentation.
25 25
26 """ 26 """
27 27
28 import sys, os, os.path, subprocess, ConfigParser, traceback, json, hashlib 28 import sys, os, os.path, subprocess, ConfigParser, traceback, json, hashlib
29 import tempfile, shutil, urlparse, pipes, time, urllib2, struct 29 import tempfile, shutil, urlparse, pipes, time, urllib2, struct
30 from datetime import datetime 30 from datetime import datetime
31 from urllib import urlencode 31 from urllib import urlencode
32 from xml.dom.minidom import parse as parseXml 32 from xml.dom.minidom import parse as parseXml
33 from sitescripts.utils import get_config, setupStderr, get_template 33 from sitescripts.utils import get_config, setupStderr, get_template
34 from sitescripts.extensions.utils import ( 34 from sitescripts.extensions.utils import compareVersions, Configuration, writeAn droidUpdateManifest
35 compareVersions, Configuration, getSafariCertificateID,
36 writeAndroidUpdateManifest)
37 35
38 MAX_BUILDS = 50 36 MAX_BUILDS = 50
39 37
40 38
41 class NightlyBuild(object): 39 class NightlyBuild(object):
42 """ 40 """
43 Performs the build process for an extension, 41 Performs the build process for an extension,
44 generating changelogs and documentation. 42 generating changelogs and documentation.
45 """ 43 """
46 44
(...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after
186 if self.config.experimental: 184 if self.config.experimental:
187 self.basename += '-experimental' 185 self.basename += '-experimental'
188 186
189 self.compat = [] 187 self.compat = []
190 if metadata.has_section('compat') and metadata.has_option('compat', 'chrome' ): 188 if metadata.has_section('compat') and metadata.has_option('compat', 'chrome' ):
191 self.compat.append({'id': 'chrome', 'minVersion': metadata.get('compat', ' chrome')}) 189 self.compat.append({'id': 'chrome', 'minVersion': metadata.get('compat', ' chrome')})
192 190
193 def readSafariMetadata(self): 191 def readSafariMetadata(self):
194 import buildtools.packagerSafari as packager 192 import buildtools.packagerSafari as packager
195 metadata = packager.readMetadata(self.tempdir, self.config.type) 193 metadata = packager.readMetadata(self.tempdir, self.config.type)
194 certs = packager.get_certificates_and_key(self.config.keyFile)[0]
196 195
197 self.certificateID = getSafariCertificateID(self.config.keyFile) 196 self.certificateID = packager.get_developer_identifier(certs)
198 self.version = packager.getBuildVersion(self.tempdir, metadata, False, self. revision) 197 self.version = packager.getBuildVersion(self.tempdir, metadata, False, self. revision)
199 self.shortVersion = metadata.get("general", "version") 198 self.shortVersion = metadata.get("general", "version")
200 self.basename = metadata.get("general", "basename") 199 self.basename = metadata.get("general", "basename")
201 200
202 def writeUpdateManifest(self): 201 def writeUpdateManifest(self):
203 """ 202 """
204 Writes update.rdf file for the current build 203 Writes update.rdf file for the current build
205 """ 204 """
206 baseDir = os.path.join(self.config.nightliesDirectory, self.basename) 205 baseDir = os.path.join(self.config.nightliesDirectory, self.basename)
207 if not os.path.exists(baseDir): 206 if not os.path.exists(baseDir):
(...skipping 302 matching lines...) Expand 10 before | Expand all | Expand 10 after
510 except Exception, ex: 509 except Exception, ex:
511 print >>sys.stderr, "The build for %s failed:" % repo 510 print >>sys.stderr, "The build for %s failed:" % repo
512 traceback.print_exc() 511 traceback.print_exc()
513 512
514 file = open(nightlyConfigFile, 'wb') 513 file = open(nightlyConfigFile, 'wb')
515 nightlyConfig.write(file) 514 nightlyConfig.write(file)
516 515
517 516
518 if __name__ == '__main__': 517 if __name__ == '__main__':
519 main() 518 main()
OLDNEW
« no previous file with comments | « no previous file | sitescripts/extensions/bin/updateUpdateManifests.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld