Bug 1160385 - adds version, buildnum support from tc releasetasks, DONTBUILD NPOTB a=testing r=rail
authorJordan Lund <jlund@mozilla.com>
Fri, 19 Feb 2016 14:53:34 -0800
changeset 322829 1ed6ec687c614e6c7154e8d1461d4fd189f8ade7
parent 322828 97dc860fe6189f0db8258b2727e3ad30b2347706
child 322830 b326f5187df6ca94453ffd5f3a6ba546a065edeb
push id5913
push userjlund@mozilla.com
push dateMon, 25 Apr 2016 16:57:49 +0000
treeherdermozilla-beta@dcaf0a6fa115 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerstesting, rail
bugs1160385
milestone47.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1160385 - adds version, buildnum support from tc releasetasks, DONTBUILD NPOTB a=testing r=rail MozReview-Commit-ID: 5otLdixBeX
testing/mozharness/scripts/release/generate-checksums.py
--- 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",
@@ -93,16 +94,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$",