Bug 1160385 - adds version, buildnum support from tc releasetasks
MozReview-Commit-ID: 5otLdixBeX
--- a/testing/mozharness/scripts/release/generate-checksums.py
+++ b/testing/mozharness/scripts/release/generate-checksums.py
@@ -7,18 +7,19 @@ import posixpath
sys.path.insert(1, os.path.dirname(os.path.dirname(sys.path[0])))
from mozharness.base.python import VirtualenvMixin, virtualenv_config_options
from mozharness.base.script import BaseScript
from mozharness.base.vcs.vcsbase import VCSMixin
from mozharness.mozilla.checksums import parse_checksums_file
from mozharness.mozilla.signing import SigningMixin
+from mozharness.mozilla.buildbot import BuildbotMixin
-class ChecksumsGenerator(BaseScript, VirtualenvMixin, SigningMixin, VCSMixin):
+class ChecksumsGenerator(BaseScript, VirtualenvMixin, SigningMixin, VCSMixin, BuildbotMixin):
config_options = [
[["--stage-product"], {
"dest": "stage_product",
"help": "Name of product used in file server's directory structure, eg: firefox, mobile",
}],
[["--version"], {
"dest": "version",
"help": "Version of release, eg: 39.0b5",
@@ -92,16 +93,29 @@ class ChecksumsGenerator(BaseScript, Vir
self.file_prefix = self._get_file_prefix()
# set the env var for boto to read our special config file
# rather than anything else we have at ~/.boto
os.environ["BOTO_CONFIG"] = os.path.abspath(self.config["credentials"])
def _pre_config_lock(self, rw_config):
super(ChecksumsGenerator, self)._pre_config_lock(rw_config)
+ # override properties from buildbot properties here as defined by
+ # taskcluster properties
+ self.read_buildbot_config()
+ if not self.buildbot_config:
+ self.warning("Skipping buildbot properties overrides")
+ return
+ # TODO: version should come from repo
+ props = self.buildbot_config["properties"]
+ for prop in ['version', 'build_number']:
+ if props.get(prop):
+ self.info("Overriding %s with %s" % (prop, props[prop]))
+ self.config[prop] = props.get(prop)
+
# These defaults are set here rather in the config because default
# lists cannot be completely overidden, only appended to.
if not self.config.get("formats"):
self.config["formats"] = ["sha512"]
if not self.config.get("includes"):
self.config["includes"] = [
"^.*\.tar\.bz2$",