[Pkg-mozext-commits] [adblock-plus] 430/464: Issue 412 - Make sure release automation creates Safari builds

David Prévot taffit at moszumanska.debian.org
Tue Jul 22 20:44:41 UTC 2014


This is an automated email from the git hooks/post-receive script.

taffit pushed a commit to branch master
in repository adblock-plus.

commit e9ef638369ff682715d1cd495f68165eed079f1c
Author: Wladimir Palant <trev at adblockplus.org>
Date:   Fri May 2 12:50:12 2014 +0200

    Issue 412 - Make sure release automation creates Safari builds
---
 build.py             | 25 ++++++++++++++-----------
 releaseAutomation.py | 17 ++++++++++++-----
 2 files changed, 26 insertions(+), 16 deletions(-)

diff --git a/build.py b/build.py
index 40e6abf..d4afa6c 100644
--- a/build.py
+++ b/build.py
@@ -387,11 +387,11 @@ def generateDocs(baseDir, scriptName, opts, args, type):
     subprocess.check_call(command)
 
 def runReleaseAutomation(baseDir, scriptName, opts, args, type):
-  keyFile = None
+  keyFiles = []
   downloadsRepo = os.path.join(baseDir, '..', 'downloads')
   for option, value in opts:
     if option in ('-k', '--key'):
-      keyFile = value
+      keyFiles.append(value)
     elif option in ('-d', '--downloads'):
       downloadsRepo = value
 
@@ -405,16 +405,19 @@ def runReleaseAutomation(baseDir, scriptName, opts, args, type):
     usage(scriptName, type, 'release')
     return
 
-  if keyFile == None:
-    if type == "gecko":
-      print >>sys.stderr, "Warning: no key file specified, creating an unsigned release build\n"
-    else:
-      print >>sys.stderr, "Error: key file is required for the release"
-      usage(scriptName, type, 'release')
-      return
+  if type == "gecko" and len(keyFiles) == 0:
+    print >>sys.stderr, "Warning: no key file specified, creating an unsigned release build\n"
+  elif type == "gecko" and len(keyFiles) > 1:
+    print >>sys.stderr, "Error: too many key files, only one required"
+    usage(scriptName, type, 'release')
+    return
+  elif type == "chrome" and len(keyFiles) != 2:
+    print >>sys.stderr, "Error: wrong number of key files specified, two keys (Chrome and Safari) required for the release"
+    usage(scriptName, type, 'release')
+    return
 
   import buildtools.releaseAutomation as releaseAutomation
-  releaseAutomation.run(baseDir, type, version, keyFile, downloadsRepo)
+  releaseAutomation.run(baseDir, type, version, keyFiles, downloadsRepo)
 
 def updatePSL(baseDir, scriptName, opts, args, type):
   import buildtools.publicSuffixListUpdater as publicSuffixListUpdater
@@ -492,7 +495,7 @@ with addCommand(runReleaseAutomation, 'release') as command:
     'probably don\'t want to run this!\n\n'\
     'Runs release automation: creates downloads for the new version, tags '\
     'source code repository as well as downloads and buildtools repository.'
-  command.addOption('File containing private key and certificates required to sign the release', short='k', long='key', value='file', types=('gecko', 'chrome'))
+  command.addOption('File containing private key and certificates required to sign the release. Note that for Chrome releases this option needs to be specified twice: first a key to sign Chrome/Opera builds, then another to sign the Safari build.', short='k', long='key', value='file', types=('gecko', 'chrome'))
   command.addOption('Directory containing downloads repository (if omitted ../downloads is assumed)', short='d', long='downloads', value='dir')
   command.params = '[options] <version>'
   command.supportedTypes = ('gecko', 'chrome')
diff --git a/releaseAutomation.py b/releaseAutomation.py
index 6eaae73..98724d2 100644
--- a/releaseAutomation.py
+++ b/releaseAutomation.py
@@ -18,7 +18,7 @@
 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":
@@ -56,16 +56,17 @@ def run(baseDir, type, version, keyFile, downloadsRepo):
   # Create a release build
   downloads = []
   if type == "gecko":
+    keyFile = keyFiles[0] if keyFiles else None
     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])
     downloads.append(buildPath)
 
     buildPathUnsigned = os.path.join(baseDir, packager.getDefaultFileName(baseDir, metadata, version, 'zip'))
@@ -73,9 +74,15 @@ def run(baseDir, type, version, keyFile, downloadsRepo):
 
     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'
 

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-mozext/adblock-plus.git



More information about the Pkg-mozext-commits mailing list