Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Bug 708656 - Use signing on demand for releases. r=bhearsum

--HG--
rename : scripts/l10n/release_repacks.sh => scripts/release/generate-sums.sh
  • Loading branch information...
commit dbeafbe802c06e1d98f790e3bb87189305c1cfc0 1 parent 443ae69
@rail rail authored
View
4 lib/perl/Release/Patcher/Config.pm
@@ -77,6 +77,10 @@ sub GetReleaseBlock {
'/pub/mozilla.org/' . $product . '/nightly/' . $version . '-candidates/' .
$buildStr . '/update/%platform%/%locale%/' . $product . '-' . $version .
'.complete.mar';
+ $releaseBlock->{'checksumsurl'} = 'http://' . $stagingServer .
+ '/pub/mozilla.org/' . $product . '/nightly/' . $version . '-candidates/' .
+ $buildStr . '/%platform%/%locale%/' . $product . '-' . $version .
+ '.checksums';
$releaseBlock->{'exceptions'} = {};
View
45 lib/python/build/l10n.py
@@ -5,7 +5,7 @@
from urllib2 import urlopen
from urlparse import urljoin
-from release.platforms import getPlatformLocales
+from release.platforms import getPlatformLocales, buildbot2ftp
from util.commands import run_cmd
from util.hg import mercurial, update
from util.paths import windows2msys
@@ -59,7 +59,9 @@ def l10nRepackPrep(sourceRepoName, objdir, mozconfigPath,
env=env)
def repackLocale(locale, l10nRepoDir, l10nBaseRepo, revision, localeSrcDir,
- l10nIni, compareLocalesRepo, env, merge=True):
+ l10nIni, compareLocalesRepo, env, merge=True,
+ prevMar=None, productName=None, platform=None,
+ version=None, oldVersion=None):
repo = "/".join([l10nBaseRepo, locale])
localeDir = path.join(l10nRepoDir, locale)
retry(mercurial, args=(repo, localeDir))
@@ -74,7 +76,44 @@ def repackLocale(locale, l10nRepoDir, l10nBaseRepo, revision, localeSrcDir,
if sys.platform.startswith('darwin'):
env["MOZ_PKG_PLATFORM"] = "mac"
run_cmd(["make", "installers-%s" % locale], cwd=localeSrcDir, env=env)
- retry(run_cmd, args=(["make", "upload", "AB_CD=%s" % locale],),
+ UPLOAD_EXTRA_FILES = []
+ if prevMar:
+ nativeDistDir = path.normpath(path.abspath(path.join(localeSrcDir,
+ '../../dist')))
+ posixDistDir = windows2msys(nativeDistDir)
+ mar = '%s/host/bin/mar' % posixDistDir
+ mbsdiff = '%s/host/bin/mbsdiff' % posixDistDir
+ current = '%s/current' % posixDistDir
+ previous = '%s/previous' % posixDistDir
+ updateDir = 'update/%s/%s' % (buildbot2ftp(platform), locale)
+ updateAbsDir = '%s/%s' % (posixDistDir, updateDir)
+ current_mar = '%s/%s-%s.complete.mar' % (updateAbsDir, productName, version)
+ partial_mar_name = '%s-%s-%s.partial.mar' % (productName, oldVersion,
+ version)
+ partial_mar = '%s/%s' % (updateAbsDir, partial_mar_name)
+ UPLOAD_EXTRA_FILES.append('%s/%s' % (updateDir, partial_mar_name))
+ env['MAR'] = mar
+ env['MBSDIFF'] = mbsdiff
+ run_cmd(['rm', '-rf', previous, current])
+ run_cmd(['mkdir', previous, current])
+ run_cmd(['perl', '../../../tools/update-packaging/unwrap_full_update.pl',
+ '../../../../%s' % prevMar],
+ cwd=path.join(nativeDistDir, 'previous'), env=env)
+ run_cmd(['perl', '../../../tools/update-packaging/unwrap_full_update.pl',
+ current_mar], cwd=path.join(nativeDistDir, 'current'), env=env)
+ run_cmd(
+ ['bash', '../../tools/update-packaging/make_incremental_update.sh',
+ partial_mar, previous, current], cwd=nativeDistDir, env=env)
+ if os.environ.get('MOZ_SIGN_CMD'):
+ run_cmd(['bash', '-c',
+ '%s -f gpg -f mar "%s"' %
+ (os.environ['MOZ_SIGN_CMD'], partial_mar)],
+ env=env)
+ UPLOAD_EXTRA_FILES.append('%s/%s.asc' % (updateDir, partial_mar_name))
+
+ retry(run_cmd,
+ args=(["make", "upload", "AB_CD=%s" % locale,
+ 'UPLOAD_EXTRA_FILES=%s' % ' '.join(UPLOAD_EXTRA_FILES)],),
kwargs={'cwd': localeSrcDir, 'env': env})
def getLocalesForChunk(possibleLocales, chunks, thisChunk):
View
3  lib/python/build/upload.py
@@ -16,6 +16,7 @@ def postUploadCmdPrefix(upload_dir=None,
to_candidates=False,
to_mobile_candidates=False,
nightly_dir=None,
+ signed=False,
):
"""Returns a post_upload.py command line for the given arguments.
It is expected that the returned value is augmented with the list of files
@@ -60,5 +61,7 @@ def postUploadCmdPrefix(upload_dir=None,
cmd.append("--release-to-mobile-candidates-dir")
if nightly_dir:
cmd.append("--nightly-dir=%s" % nightly_dir)
+ if signed:
+ cmd.append("--signed")
return " ".join(cmd)
View
52 lib/python/release/download.py
@@ -2,12 +2,14 @@
from os import path
import urllib
from urllib import urlretrieve
+from urllib2 import urlopen, HTTPError
-from release.platforms import ftp_platform_map
+from release.platforms import ftp_platform_map, buildbot2ftp
from release.l10n import makeReleaseRepackUrls
from release.paths import makeCandidatesDir
from util.paths import windows2msys
from util.file import directoryContains
+from util.commands import run_cmd
import logging
log = logging.getLogger(__name__)
@@ -27,11 +29,13 @@ def getInstallerExt(platform):
return installer_ext_map[platform]
def downloadReleaseBuilds(stageServer, productName, brandName, version,
- buildNumber, platform, candidatesDir=None):
+ buildNumber, platform, candidatesDir=None,
+ signed=False):
if candidatesDir is None:
candidatesDir = makeCandidatesDir(productName, version, buildNumber,
protocol='http', server=stageServer)
- files = makeReleaseRepackUrls(productName, brandName, version, platform)
+ files = makeReleaseRepackUrls(productName, brandName, version, platform,
+ signed=signed)
env = {}
for fileName, remoteFile in files.iteritems():
@@ -50,6 +54,34 @@ def downloadReleaseBuilds(stageServer, productName, brandName, version,
return env
+def downloadUpdate(stageServer, productName, version, buildNumber,
+ platform, locale, candidatesDir=None):
+ if candidatesDir is None:
+ candidatesDir = makeCandidatesDir(productName, version, buildNumber,
+ protocol='http', server=stageServer)
+ fileName = '%s-%s.complete.mar' % (productName, version)
+ destFileName = '%s-%s.%s.complete.mar' % (productName, version, locale)
+ platformDir = buildbot2ftp(platform)
+ url = '/'.join([p.strip('/') for p in [
+ candidatesDir, 'update', platformDir, locale, fileName]])
+ log.info("Downloading %s to %s", url, destFileName)
+ remote_f = urlopen(url)
+ local_f = open(destFileName, "wb")
+ local_f.write(remote_f.read())
+ local_f.close()
+ return destFileName
+
+def downloadUpdateIgnore404(*args, **kwargs):
+ try:
+ return downloadUpdate(*args, **kwargs)
+ except HTTPError, e:
+ if e.code == 404:
+ # New locale
+ log.warning('Got 404. Skipping %s' % e.geturl())
+ return None
+ else:
+ raise
+
def expectedFiles(unsignedDir, locale, platform, signedPlatforms,
firstLocale='en-US'):
""" When checking a full set of downloaded release builds,
@@ -84,3 +116,17 @@ def expectedFiles(unsignedDir, locale, platform, signedPlatforms,
langpack = False
return update and packages and langpack
+
+def rsyncFilesByPattern(server, userName, sshKey, source_dir, target_dir,
+ pattern):
+ cmd = ['rsync', '-e',
+ 'ssh -l %s -oIdentityFile=%s' % (userName, sshKey),
+ '-av', '--include=%s' % pattern, '--include=*/', '--exclude=*',
+ '%s:%s' % (server, source_dir), target_dir]
+ run_cmd(cmd)
+
+def rsyncFiles(files, server, userName, sshKey, target_dir):
+ cmd = ['rsync', '-e',
+ 'ssh -l %s -oIdentityFile=%s' % (userName, sshKey),
+ '-av'] + files + ['%s:%s' % (server, target_dir)]
+ run_cmd(cmd)
View
20 lib/python/release/l10n.py
@@ -70,7 +70,7 @@ def getL10nRepositories(fileName, l10nRepoPath, relbranch=None):
def makeReleaseRepackUrls(productName, brandName, version, platform,
- locale='en-US'):
+ locale='en-US', signed=False):
longVersion = version
builds = {}
if productName not in ('fennec',):
@@ -86,12 +86,18 @@ def makeReleaseRepackUrls(productName, brandName, version, platform,
elif platform.startswith('win'):
filename = '%s.zip' % productName
instname = '%s.exe' % productName
- builds[filename] = '/'.join([p.strip('/') for p in [
- 'unsigned', platformDir, locale,
- '%s-%s.zip' % (productName, version)]])
- builds[instname] = '/'.join([p.strip('/') for p in [
- 'unsigned', platformDir, locale,
- '%s Setup %s.exe' % (brandName, longVersion)]])
+ prefix = []
+ if not signed:
+ prefix.append('unsigned')
+ prefix.extend([platformDir, locale])
+ builds[filename] = '/'.join(
+ [p.strip('/') for p in
+ prefix + ['%s-%s.zip' % (productName, version)]]
+ )
+ builds[instname] = '/'.join(
+ [p.strip('/') for p in
+ prefix + ['%s Setup %s.exe' % (brandName, longVersion)]]
+ )
else:
raise "Unsupported platform"
else:
View
42 lib/python/release/signing.py
@@ -0,0 +1,42 @@
+import os
+from util.commands import run_cmd
+
+def generateChecksums(checksums_dir, sums_info):
+ """
+ Generates {MD5,SHA1,etc}SUMS files using *.checksums files.
+
+ @type checksums_dir: string
+ @param checksums_dir: Directory name wich *.checksums files
+
+ @type sums_info: dict
+ @param sums_info: A dictionary which contains hash type and output file
+ pairs. Example: {'sha1': '/tmp/SHA1SUMS',
+ 'md5': '/tmp/MD5SUMS'}
+ """
+ sums = {}
+ for hash_type in sums_info.keys():
+ sums[hash_type] = []
+ for top, dirs, files in os.walk(checksums_dir):
+ files = [f for f in files if f.endswith('.checksums')]
+ for f in files:
+ fd = open(os.path.join(top, f))
+ for line in fd:
+ line = line.rstrip()
+ try:
+ hash, hash_type, size, file_name = line.split(None, 3)
+ except ValueError:
+ print "Failed to parse the following line:"
+ print line
+ raise
+ if sums.has_key(hash_type):
+ sums[hash_type].append((hash, file_name))
+ for hash_type in sums_info.keys():
+ sums_file = open(sums_info[hash_type], 'w')
+ # sort by file name
+ for hash, file_name in sorted(sums[hash_type], key=lambda x: x[1]):
+ sums_file.write('%s %s\n' % (hash, file_name))
+ sums_file.close()
+
+def signFiles(files):
+ for f in files:
+ run_cmd(['bash', '-c', os.environ['MOZ_SIGN_CMD'] + ' -f gpg "%s"' % f])
View
108 scripts/l10n/create-release-repacks.py
@@ -11,7 +11,7 @@
from build.l10n import repackLocale, l10nRepackPrep
import build.misc
from build.upload import postUploadCmdPrefix
-from release.download import downloadReleaseBuilds
+from release.download import downloadReleaseBuilds, downloadUpdateIgnore404
from release.info import readReleaseConfig, readBranchConfig
from release.l10n import getReleaseLocalesForChunk
from util.hg import mercurial, update, make_hg_url
@@ -29,7 +29,8 @@ class RepackError(Exception):
def createRepacks(sourceRepo, revision, l10nRepoDir, l10nBaseRepo,
mozconfigPath, objdir, makeDirs, appName, locales, product,
version, buildNumber, stageServer, stageUsername, stageSshKey,
- compareLocalesRepo, merge, platform, brand):
+ compareLocalesRepo, merge, platform, brand,
+ generatePartials=False, oldVersion=None, oldBuildNumber=None):
sourceRepoName = path.split(sourceRepo)[-1]
localeSrcDir = path.join(sourceRepoName, objdir, appName, "locales")
# Even on Windows we need to use "/" as a separator for this because
@@ -45,13 +46,18 @@ def createRepacks(sourceRepo, revision, l10nRepoDir, l10nBaseRepo,
"UPLOAD_SSH_KEY": stageSshKey,
"UPLOAD_TO_TEMP": "1",
"MOZ_PKG_PRETTYNAMES": "1",
- "POST_UPLOAD_CMD": postUploadCmdPrefix(
- to_candidates=True,
- product=product,
- version=version,
- buildNumber=buildNumber
- )
}
+ signed = False
+ if os.environ.get('MOZ_SIGN_CMD'):
+ env['MOZ_SIGN_CMD'] = os.environ['MOZ_SIGN_CMD']
+ signed = True
+ env['POST_UPLOAD_CMD'] = postUploadCmdPrefix(
+ to_candidates=True,
+ product=product,
+ version=version,
+ buildNumber=buildNumber,
+ signed=signed,
+ )
build.misc.cleanupObjdir(sourceRepoName, objdir, appName)
retry(mercurial, args=(sourceRepo, sourceRepoName))
update(sourceRepoName, revision=revision)
@@ -59,14 +65,27 @@ def createRepacks(sourceRepo, revision, l10nRepoDir, l10nBaseRepo,
localeSrcDir, env)
input_env = retry(downloadReleaseBuilds,
args=(stageServer, product, brand, version, buildNumber,
- platform))
+ platform),
+ kwargs={'signed': signed})
env.update(input_env)
failed = []
for l in locales:
try:
- repackLocale(l, l10nRepoDir, l10nBaseRepo, revision,
- localeSrcDir, l10nIni, compareLocalesRepo, env, merge)
+ prevMar = None
+ if generatePartials:
+ prevMar = retry(
+ downloadUpdateIgnore404,
+ args=(stageServer, product, oldVersion, oldBuildNumber,
+ platform, l)
+ )
+ repackLocale(locale=l, l10nRepoDir=l10nRepoDir,
+ l10nBaseRepo=l10nBaseRepo, revision=revision,
+ localeSrcDir=localeSrcDir, l10nIni=l10nIni,
+ compareLocalesRepo=compareLocalesRepo, env=env,
+ merge=merge, prevMar=prevMar,
+ productName=product, platform=platform,
+ version=version, oldVersion=oldVersion)
except Exception, e:
failed.append((l, format_exc()))
@@ -83,7 +102,6 @@ def createRepacks(sourceRepo, revision, l10nRepoDir, l10nBaseRepo,
"productName", "version", "buildNumber")
def validate(options, args):
- err = False
if not options.configfile:
log.info("Must pass --configfile")
sys.exit(1)
@@ -102,21 +120,14 @@ def validate(options, args):
"locale option cannot be used when chunking"
else:
if len(options.locales) < 1:
- err = True
- log.error("Need at least one locale to repack")
-
- try:
- releaseConfig = readReleaseConfig(releaseConfigFile,
- required=REQUIRED_RELEASE_CONFIG)
- sourceRepoName = releaseConfig['sourceRepositories'][options.source_repo_key]['name']
- branchConfig = readBranchConfig(branchConfigDir, branchConfigFile,
- sourceRepoName,
- required=REQUIRED_BRANCH_CONFIG)
- except:
- err = True
-
- if err:
- sys.exit(1)
+ raise Exception('Need at least one locale to repack')
+
+ releaseConfig = readReleaseConfig(releaseConfigFile,
+ required=REQUIRED_RELEASE_CONFIG)
+ sourceRepoName = releaseConfig['sourceRepositories'][options.source_repo_key]['name']
+ branchConfig = readBranchConfig(branchConfigDir, branchConfigFile,
+ sourceRepoName,
+ required=REQUIRED_BRANCH_CONFIG)
return branchConfig, releaseConfig
if __name__ == "__main__":
@@ -144,8 +155,15 @@ def validate(options, args):
parser.add_option("--source-repo-key", dest="source_repo_key")
parser.add_option("--chunks", dest="chunks", type="int")
parser.add_option("--this-chunk", dest="thisChunk", type="int")
+ parser.add_option("--generate-partials", dest="generatePartials",
+ action='store_true', default=False)
options, args = parser.parse_args()
+ if options.generatePartials:
+ makeDirs.extend([
+ path.join("modules", "libbz2"),
+ path.join("other-licenses", "bsdiff")
+ ])
retry(mercurial, args=(options.buildbotConfigs, "buildbot-configs"))
update("buildbot-configs", revision=options.releaseTag)
sys.path.append(os.getcwd())
@@ -176,14 +194,28 @@ def validate(options, args):
stageSshKey = path.join("~", ".ssh", branchConfig["stage_ssh_key"])
createRepacks(
- make_hg_url(branchConfig["hghost"], sourceRepoInfo["path"]),
- options.releaseTag, l10nRepoDir,
- make_hg_url(branchConfig["hghost"], releaseConfig["l10nRepoPath"]),
- mozconfig, options.objdir, makeDirs,
- releaseConfig["appName"], locales, releaseConfig["productName"],
- releaseConfig["version"], int(releaseConfig["buildNumber"]),
- branchConfig["stage_server"], branchConfig["stage_username"],
- stageSshKey,
- make_hg_url(branchConfig["hghost"],
- branchConfig["compare_locales_repo_path"]),
- releaseConfig["mergeLocales"], options.platform, brandName)
+ sourceRepo=make_hg_url(branchConfig["hghost"], sourceRepoInfo["path"]),
+ revision=options.releaseTag,
+ l10nRepoDir=l10nRepoDir,
+ l10nBaseRepo=make_hg_url(branchConfig["hghost"],
+ releaseConfig["l10nRepoPath"]),
+ mozconfigPath=mozconfig,
+ objdir=options.objdir,
+ makeDirs=makeDirs,
+ appName=releaseConfig["appName"],
+ locales=locales,
+ product=releaseConfig["productName"],
+ version=releaseConfig["version"],
+ buildNumber=int(releaseConfig["buildNumber"]),
+ stageServer=branchConfig["stage_server"],
+ stageUsername=branchConfig["stage_username"],
+ stageSshKey=stageSshKey,
+ compareLocalesRepo=make_hg_url(branchConfig["hghost"],
+ branchConfig["compare_locales_repo_path"]),
+ merge=releaseConfig["mergeLocales"],
+ platform=options.platform,
+ brand=brandName,
+ generatePartials=options.generatePartials,
+ oldVersion=releaseConfig["oldVersion"],
+ oldBuildNumber=releaseConfig["oldBuildNumber"],
+ )
View
10 scripts/l10n/release_repacks.sh
@@ -18,6 +18,10 @@ platform=$1
branchConfig=$2
chunks=$3
thisChunk=$4
+generatePartials=$5
+if [ "$generatePartials" = "generatePartials" ]; then
+ generatePartials="--generate-partials"
+fi
branch=$(basename $($JSONTOOL -k properties.branch $PROPERTIES_FILE))
builder=$($JSONTOOL -k properties.buildername $PROPERTIES_FILE)
@@ -34,14 +38,16 @@ if [ -z "$CLOBBERER_URL" ]; then
export CLOBBERER_URL="http://build.mozilla.org/clobberer"
fi
+export MOZ_SIGN_CMD="$MOZ_SIGN_CMD"
+
cd $SCRIPTS_DIR/../..
$PYTHON $SCRIPTS_DIR/clobberer/clobberer.py -s scripts -s buildprops.json \
$CLOBBERER_URL $branch $builder $slavebuilddir $slavename $master
cd $SCRIPTS_DIR/..
$PYTHON $SCRIPTS_DIR/buildfarm/maintenance/purge_builds.py \
- -s 6 -n info -n 'rel-*' -n $slavebuilddir
+ -s 7 -n info -n 'rel-*' -n $slavebuilddir
cd $workdir
$PYTHON $MY_DIR/create-release-repacks.py -c $branchConfig -r $releaseConfig \
-b $BUILDBOT_CONFIGS -t $releaseTag -p $platform \
- --chunks $chunks --this-chunk $thisChunk
+ --chunks $chunks --this-chunk $thisChunk $generatePartials
View
7 scripts/l10n/standalone_repacks.sh
@@ -16,6 +16,10 @@ workdir=`pwd`
platform=$1
branchConfig=$2
+generatePartials=$3
+if [ "$generatePartials" = "generatePartials" ]; then
+ generatePartials="--generate-partials"
+fi
releaseConfig=$($JSONTOOL -k properties.release_config $PROPERTIES_FILE)
releaseTag=$($JSONTOOL -k properties.script_repo_revision $PROPERTIES_FILE)
@@ -24,6 +28,7 @@ locales=$($JSONTOOL -k properties.locale $PROPERTIES_FILE)
if [ -z "$BUILDBOT_CONFIGS" ]; then
export BUILDBOT_CONFIGS="http://hg.mozilla.org/build/buildbot-configs"
fi
+export MOZ_SIGN_CMD="$MOZ_SIGN_CMD"
LOCALE_OPT=
IFS=":"
@@ -37,4 +42,4 @@ cd $workdir
$PYTHON $MY_DIR/create-release-repacks.py -c $branchConfig -r $releaseConfig \
-b $BUILDBOT_CONFIGS -t $releaseTag -p $platform \
- $LOCALE_OPT
+ $LOCALE_OPT $generatePartials
View
71 scripts/release/KEY
@@ -0,0 +1,71 @@
+This file contains the PGP keys of various developers that work on
+Mozilla and its subprojects (such as Firefox and Thunderbird).
+
+Please don't use these keys for email unless you have asked the owner
+because some keys are only used for code signing.
+
+Please realize that this file itself or the public key servers may be
+compromised. You are encouraged to validate the authenticity of these keys in
+an out-of-band manner.
+
+Mozilla users: pgp < KEY
+Mozilla developers:
+ (pgpk -ll <your name> && pgpk -xa <your name>) >> KEY
+ or
+ (gpg --fingerprint --list-sigs <your name> \
+ && gpg --armor --export <your name>) >> KEY
+
+Mozilla developers: please ensure that your key is also available via the
+PGP keyservers (such as pgpkeys.mit.edu).
+
+pub 1024D/1EBCAB3A 2011-07-22 [expires: 2013-07-21]
+ Key fingerprint = 9D03 193D 6BDC 541B D796 C4E4 7F4D 6645 1EBC AB3A
+uid Mozilla Software Releases <releases@mozilla.org>
+sig 3 1EBCAB3A 2011-07-22 Mozilla Software Releases <releases@mozilla.org>
+sub 1024D/C52175E2 2011-07-22 [expires: 2013-07-21]
+sig 1EBCAB3A 2011-07-22 Mozilla Software Releases <releases@mozilla.org>
+sub 2048g/D8A758E6 2011-07-22 [expires: 2013-07-21]
+sig 1EBCAB3A 2011-07-22 Mozilla Software Releases <releases@mozilla.org>
+
+-----BEGIN PGP PUBLIC KEY BLOCK-----
+Version: GnuPG v1.4.9 (Cygwin)
+
+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
+=i3MY
+-----END PGP PUBLIC KEY BLOCK-----
View
92 scripts/release/generate-sums.py
@@ -0,0 +1,92 @@
+#!/usr/bin/env python
+
+
+import logging
+import os
+from os import path
+import sys
+
+sys.path.append(path.join(path.dirname(__file__), "../../lib/python"))
+logging.basicConfig(stream=sys.stdout, level=logging.INFO, format="%(message)s")
+log = logging.getLogger(__name__)
+
+from release.info import readReleaseConfig, readBranchConfig
+from util.hg import update, mercurial, make_hg_url
+from util.commands import run_remote_cmd
+
+from release.download import rsyncFilesByPattern, rsyncFiles
+from release.signing import generateChecksums, signFiles
+from release.paths import makeCandidatesDir
+
+DEFAULT_BUILDBOT_CONFIGS_REPO = make_hg_url('hg.mozilla.org',
+ 'build/buildbot-configs')
+
+REQUIRED_BRANCH_CONFIG = ("stage_server", "stage_username", "stage_ssh_key")
+REQUIRED_RELEASE_CONFIG = ("productName", "version", "buildNumber")
+
+def validate(options, args):
+ if not options.configfile:
+ log.info("Must pass --configfile")
+ sys.exit(1)
+ releaseConfigFile = path.join("buildbot-configs", options.releaseConfig)
+ branchConfigFile = path.join("buildbot-configs", options.configfile)
+ branchConfigDir = path.dirname(branchConfigFile)
+
+ if not path.exists(branchConfigFile):
+ log.info("%s does not exist!" % branchConfigFile)
+ sys.exit(1)
+
+ releaseConfig = readReleaseConfig(releaseConfigFile,
+ required=REQUIRED_RELEASE_CONFIG)
+ sourceRepoName = releaseConfig['sourceRepositories'][options.sourceRepoKey]['name']
+ branchConfig = readBranchConfig(branchConfigDir, branchConfigFile,
+ sourceRepoName,
+ required=REQUIRED_BRANCH_CONFIG)
+ return branchConfig, releaseConfig
+
+
+if __name__ == '__main__':
+ from optparse import OptionParser
+ parser = OptionParser("")
+
+ parser.set_defaults(
+ buildbotConfigs=os.environ.get("BUILDBOT_CONFIGS",
+ DEFAULT_BUILDBOT_CONFIGS_REPO),
+ sourceRepoKey="mozilla",
+ )
+ parser.add_option("-c", "--configfile", dest="configfile")
+ parser.add_option("-r", "--release-config", dest="releaseConfig")
+ parser.add_option("-b", "--buildbot-configs", dest="buildbotConfigs")
+ parser.add_option("-t", "--release-tag", dest="releaseTag")
+ parser.add_option("--source-repo-key", dest="sourceRepoKey")
+
+ options, args = parser.parse_args()
+ mercurial(options.buildbotConfigs, "buildbot-configs")
+ update("buildbot-configs", revision=options.releaseTag)
+
+ branchConfig, releaseConfig = validate(options, args)
+
+ productName = releaseConfig['productName']
+ version = releaseConfig['version']
+ buildNumber = releaseConfig['buildNumber']
+ stageServer = branchConfig['stage_server']
+ stageUsername = branchConfig['stage_username']
+ stageSshKey = path.join(os.path.expanduser("~"), ".ssh",
+ branchConfig["stage_ssh_key"])
+
+ candidatesDir = makeCandidatesDir(productName, version, buildNumber)
+ rsyncFilesByPattern(server=stageServer, userName=stageUsername,
+ sshKey=stageSshKey, source_dir=candidatesDir,
+ target_dir='temp/', pattern='*.checksums')
+ types = {'sha1': 'SHA1SUMS', 'md5': 'MD5SUMS', 'sha512': 'SHA512SUMS'}
+ generateChecksums('temp', types)
+ files = types.values()
+ signFiles(files)
+ upload_files = files + ['%s.asc' % x for x in files] + \
+ [path.join(path.dirname(__file__), 'KEY')]
+ rsyncFiles(files=upload_files, server=stageServer, userName=stageUsername,
+ sshKey=stageSshKey, target_dir=candidatesDir)
+ cmd = 'mkdir -v -m 2775 %s/contrib %s/contrib-localized' % \
+ (candidatesDir, candidatesDir)
+ run_remote_cmd(cmd, server=stageServer, username=stageUsername,
+ sshKey=stageSshKey)
View
45 scripts/release/generate-sums.sh
@@ -0,0 +1,45 @@
+#!/bin/sh
+set -e
+set -x
+# This ugly hack is a cross-platform (Linux/Mac/Windows+MSYS) way to get the
+# absolute path to the directory containing this script
+pushd `dirname $0` &>/dev/null
+MY_DIR=$(pwd)
+popd &>/dev/null
+SCRIPTS_DIR="$MY_DIR/../../"
+PYTHON="/tools/python/bin/python"
+if [ ! -x $PYTHON ]; then
+ PYTHON=python
+fi
+JSONTOOL="$PYTHON $SCRIPTS_DIR/buildfarm/utils/jsontool.py"
+workdir=`pwd`
+
+branchConfig=$1
+
+branch=$(basename $($JSONTOOL -k properties.branch $PROPERTIES_FILE))
+builder=$($JSONTOOL -k properties.buildername $PROPERTIES_FILE)
+slavebuilddir=$($JSONTOOL -k properties.slavebuilddir $PROPERTIES_FILE)
+slavename=$($JSONTOOL -k properties.slavename $PROPERTIES_FILE)
+master=$($JSONTOOL -k properties.master $PROPERTIES_FILE)
+releaseConfig=$($JSONTOOL -k properties.release_config $PROPERTIES_FILE)
+releaseTag=$($JSONTOOL -k properties.script_repo_revision $PROPERTIES_FILE)
+
+if [ -z "$BUILDBOT_CONFIGS" ]; then
+ export BUILDBOT_CONFIGS="http://hg.mozilla.org/build/buildbot-configs"
+fi
+if [ -z "$CLOBBERER_URL" ]; then
+ export CLOBBERER_URL="http://build.mozilla.org/clobberer"
+fi
+
+export MOZ_SIGN_CMD="$MOZ_SIGN_CMD"
+
+cd $SCRIPTS_DIR/../..
+$PYTHON $SCRIPTS_DIR/clobberer/clobberer.py -s scripts -s buildprops.json \
+ $CLOBBERER_URL $branch $builder $slavebuilddir $slavename $master
+cd $SCRIPTS_DIR/..
+$PYTHON $SCRIPTS_DIR/buildfarm/maintenance/purge_builds.py \
+ -s 0.5 -n info -n 'rel-*' -n $slavebuilddir
+cd $workdir
+
+$PYTHON $MY_DIR/generate-sums.py -c $branchConfig -r $releaseConfig \
+ -b $BUILDBOT_CONFIGS -t $releaseTag
View
6 stage/post_upload.py
@@ -204,7 +204,7 @@ def ReleaseToCandidatesDir(options, upload_dir, files):
for f in files:
realCandidatesPath = candidatesPath
- if 'win32' in f and '/logs/' not in f:
+ if not options.signed and 'win32' in f and '/logs/' not in f:
realCandidatesPath = os.path.join(realCandidatesPath, 'unsigned')
url = os.path.join(candidatesUrl, 'unsigned')
else:
@@ -251,7 +251,7 @@ def ReleaseToMobileCandidatesDir(options, upload_dir, files):
for f in files:
realCandidatesPath = candidatesPath
- if 'android' in options.builddir:
+ if not options.signed and 'android' in options.builddir:
realCandidatesPath = os.path.join(realCandidatesPath, 'unsigned',
options.builddir)
url = os.path.join(candidatesUrl, 'unsigned',
@@ -350,6 +350,8 @@ def ReleaseToTryBuilds(options, upload_dir, files):
parser.add_option("--release-to-try-builds",
action="store_true", dest="release_to_try_builds",
help="Copy files to try-builds/$who-$revision")
+ parser.add_option("--signed", action="store_true", dest="signed",
+ help="Don't use unsigned directory for uploaded files")
(options, args) = parser.parse_args()
if len(args) < 2:

0 comments on commit dbeafbe

Please sign in to comment.
Something went wrong with that request. Please try again.