Bug 1178286 - switch release automation source builder to taskcluster r=jlund

This commit is contained in:
Rail Aliiev 2016-02-22 12:51:09 -08:00
parent a90956f038
commit f0aa4e91e0
4 changed files with 53 additions and 8 deletions

View File

@ -5,6 +5,7 @@ config = {
'checkout-sources',
'setup-mock',
'package-source',
'generate-source-signing-manifest',
],
'stage_platform': 'source', # Not used, but required by the script
'buildbot_json_path': 'buildprops.json',
@ -15,8 +16,5 @@ config = {
'TINDERBOX_OUTPUT': '1',
'LC_ALL': 'C',
},
'tooltool_script': ["/builds/tooltool.py"],
'tooltool_bootstrap': "setup.sh",
'tooltool_manifest_src': "browser/config/tooltool-manifests/linux64/releng.manifest",
'src_mozconfig': 'browser/config/mozconfigs/linux64/nightly',
'src_mozconfig': 'browser/config/mozconfigs/linux64/source',
}

View File

@ -1883,28 +1883,57 @@ or run without that action (ie: --no-{action})"
def preflight_package_source(self):
self._get_mozconfig()
self._run_tooltool()
def package_source(self):
"""generates source archives and uploads them"""
env = self.query_build_env()
env.update(self.query_mach_build_env())
python = self.query_exe('python2.7')
dirs = self.query_abs_dirs()
self.run_command_m(
command=[python, 'mach', '--log-no-times', 'configure'],
cwd=self.query_abs_dirs()['abs_src_dir'],
cwd=dirs['abs_src_dir'],
env=env, output_timeout=60*3, halt_on_failure=True,
)
self.run_command_m(
command=[
'make', 'source-package', 'hg-bundle',
'make', 'source-package', 'hg-bundle', 'source-upload',
'HG_BUNDLE_REVISION=%s' % self.query_revision(),
'UPLOAD_HG_BUNDLE=1',
],
cwd=self.query_abs_dirs()['abs_obj_dir'],
cwd=dirs['abs_obj_dir'],
env=env, output_timeout=60*45, halt_on_failure=True,
)
def generate_source_signing_manifest(self):
"""Sign source checksum file"""
env = self.query_build_env()
env.update(self.query_mach_build_env())
if env.get("UPLOAD_HOST") != "localhost":
self.warning("Skipping signing manifest generation. Set "
"UPLOAD_HOST to `localhost' to enable.")
return
if not env.get("UPLOAD_PATH"):
self.warning("Skipping signing manifest generation. Set "
"UPLOAD_PATH to enable.")
return
dirs = self.query_abs_dirs()
objdir = dirs['abs_obj_dir']
output = self.get_output_from_command_m(
command=['make', 'echo-variable-SOURCE_CHECKSUM_FILE'],
cwd=objdir,
)
files = shlex.split(output)
abs_files = [os.path.abspath(os.path.join(objdir, f)) for f in files]
manifest_file = os.path.join(env["UPLOAD_PATH"],
"signing_manifest.json")
self.write_to_file(manifest_file,
self.generate_signing_manifest(abs_files))
def check_test(self):
c = self.config
dirs = self.query_abs_dirs()

View File

@ -9,6 +9,7 @@
import os
import re
import json
from mozharness.base.errors import BaseErrorList
from mozharness.base.log import ERROR, FATAL
@ -60,6 +61,22 @@ class SigningMixin(BaseSigningMixin):
cmd += ['-H', h]
return cmd
def generate_signing_manifest(self, files):
"""Generate signing manifest for signingworkers
Every entry in the manifest requires a dictionary of
"file_to_sign" (basename) and "hash" (SHA512) of every file to be
signed. Signing format is defined in the signing task.
"""
manifest_content = [
{
"file_to_sign": os.path.basename(f),
"hash": self.query_sha512sum(f)
}
for f in files
]
return json.dumps(manifest_content)
# MobileSigningMixin {{{1
class MobileSigningMixin(AndroidSigningMixin, SigningMixin):

View File

@ -37,6 +37,7 @@ class FxDesktopBuild(BuildScript, object):
'sendchange',
'check-test',
'package-source',
'generate-source-signing-manifest',
'multi-l10n',
'generate-build-stats',
'update',