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

Unified Diff: releaseAutomation.py

Issue 5108575248580608: Issue 412 - Make sure release automation creates Safari builds (Closed)
Patch Set: Created May 2, 2014, 7:10 a.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« build.py ('K') | « build.py ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: releaseAutomation.py
===================================================================
--- a/releaseAutomation.py
+++ b/releaseAutomation.py
@@ -13,17 +13,17 @@
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with Adblock Plus. If not, see <http://www.gnu.org/licenses/>.
import os, re, codecs, subprocess, tarfile, json
from StringIO import StringIO
-def run(baseDir, type, version, keyFile, downloadsRepo):
+def run(baseDir, type, version, keyFiles, downloadsRepo):
if type == "gecko":
import buildtools.packagerGecko as packager
elif type == "chrome":
import buildtools.packagerChrome as packager
# Replace version number in metadata file "manually", ConfigParser will mess
# up the order of lines.
metadata = packager.readMetadata(baseDir, type)
@@ -51,36 +51,43 @@ def run(baseDir, type, version, keyFile,
# Now commit the change and tag it
subprocess.check_call(['hg', 'commit', '-R', baseDir, '-m', 'Releasing %s %s' % (extensionName, version)])
subprocess.check_call(['hg', 'tag', '-R', baseDir, '-f', version])
# Create a release build
downloads = []
if type == "gecko":
+ keyFile = keyFiles[0] if len(keyFiles) else None
Sebastian Noack 2014/05/02 08:29:09 len() isn't needed here, since empty lists evaluat
metadata = packager.readMetadata(baseDir, type)
buildPath = os.path.join(downloadsRepo, packager.getDefaultFileName(baseDir, metadata, version, 'xpi'))
packager.createBuild(baseDir, type=type, outFile=buildPath, releaseBuild=True, keyFile=keyFile)
downloads.append(buildPath)
elif type == "chrome":
- # We actually have to create three different builds for Chrome: signed a unsigned Chrome builds
- # (the latter for Chrome Web Store) and a signed Opera build.
+ # We actually have to create four different builds for Chrome: signed a unsigned Chrome builds
+ # (the latter for Chrome Web Store), a signed Opera build and a signed Safari build.
metadata = packager.readMetadata(baseDir, type)
buildPath = os.path.join(downloadsRepo, packager.getDefaultFileName(baseDir, metadata, version, 'crx'))
- packager.createBuild(baseDir, type=type, outFile=buildPath, releaseBuild=True, keyFile=keyFile)
+ packager.createBuild(baseDir, type=type, outFile=buildPath, releaseBuild=True, keyFile=keyFiles[0])
Sebastian Noack 2014/05/02 08:29:09 Why don't you handle missing keyFiles here, but fo
Wladimir Palant 2014/05/02 10:50:50 An unsigned release for Gecko is an option and we
Sebastian Noack 2014/05/02 10:54:15 Agreed.
downloads.append(buildPath)
buildPathUnsigned = os.path.join(baseDir, packager.getDefaultFileName(baseDir, metadata, version, 'zip'))
packager.createBuild(baseDir, type=type, outFile=buildPathUnsigned, releaseBuild=True, keyFile=None)
metadataOpera = packager.readMetadata(baseDir, "opera")
buildPathOpera = os.path.join(downloadsRepo, packager.getDefaultFileName(baseDir, metadataOpera, version, 'crx'))
- packager.createBuild(baseDir, type="opera", outFile=buildPathOpera, releaseBuild=True, keyFile=keyFile)
+ packager.createBuild(baseDir, type="opera", outFile=buildPathOpera, releaseBuild=True, keyFile=keyFiles[0])
downloads.append(buildPathOpera)
+ import buildtools.packagerSafari as packagerSafari
+ metadataSafari = packagerSafari.readMetadata(baseDir, "safari")
+ buildPathSafari = os.path.join(downloadsRepo, packagerSafari.getDefaultFileName(baseDir, metadataSafari, version, 'safariextz'))
+ packagerSafari.createBuild(baseDir, type="safari", outFile=buildPathSafari, releaseBuild=True, keyFile=keyFiles[1])
+ downloads.append(buildPathSafari)
+
# Create source archive
archivePath = os.path.splitext(buildPath)[0] + '-source.tgz'
archiveHandle = open(archivePath, 'wb')
archive = tarfile.open(fileobj=archiveHandle, name=os.path.basename(archivePath), mode='w:gz')
data = subprocess.check_output(['hg', 'archive', '-R', baseDir, '-t', 'tar', '-S', '-'])
repoArchive = tarfile.open(fileobj=StringIO(data), mode='r:')
for fileInfo in repoArchive:
« build.py ('K') | « build.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld