Bug 1236954 - partner repack script changes to read properties from buildprops.json; r?jlund
Adds --require-buildprops option used by the standalone builder. When this option is
specified, a partner property must be present in the buildprops.json file. This limits
the repack operation to that single partner.
--- a/testing/mozharness/scripts/desktop_partner_repacks.py
+++ b/testing/mozharness/scripts/desktop_partner_repacks.py
@@ -63,25 +63,31 @@ class DesktopPartnerRepacks(ReleaseMixin
[["--hgroot"], {
"dest": "hgroot",
"help": "Use a different hg server for retrieving files",
}],
[["--hgrepo"], {
"dest": "hgrepo",
"help": "Use a different base repo for retrieving files",
}],
+ [["--require-buildprops"], {
+ "action": "store_true",
+ "dest": "require_buildprops",
+ "default": False,
+ "help": "Read in config options (like partner) from the buildbot properties file."
+ }],
]
def __init__(self):
# fxbuild style:
buildscript_kwargs = {
'all_actions': DesktopPartnerRepacks.actions,
'default_actions': DesktopPartnerRepacks.actions,
'config': {
- "buildbot_json_path": "buildprops.json",
+ 'buildbot_json_path': os.environ.get('PROPERTIES_FILE'),
"log_name": "partner-repacks",
"hashType": "sha512",
'virtualenv_modules': [
'requests==2.2.1',
'PyHawk-with-a-single-extra-commit==0.1.5',
'taskcluster==0.0.15',
's3cmd==1.6.0',
],
@@ -101,16 +107,27 @@ class DesktopPartnerRepacks(ReleaseMixin
self.fatal("Version (-v) not supplied.")
if 'buildnumber' not in self.config:
self.fatal("Build number (-n) not supplied.")
if 'repo_file' not in self.config:
self.fatal("repo_file not supplied.")
if 'repack_manifests_url' not in self.config:
self.fatal("repack_manifests_url not supplied.")
+ def _pre_config_lock(self, rw_config):
+ if self.config.get('require_buildprops', False) is True:
+ self.read_buildbot_config()
+ if not self.buildbot_config:
+ self.fatal("Unable to load properties from file: %s" % self.config.get('buildbot_json_path'))
+ buildbot_props = self.buildbot_config.get('properties', {})
+ partner = buildbot_props.get('partner')
+ if not partner:
+ self.fatal("No partner specified in buildprops.json.")
+ self.config['partner'] = partner
+
def query_abs_dirs(self):
if self.abs_dirs:
return self.abs_dirs
abs_dirs = super(DesktopPartnerRepacks, self).query_abs_dirs()
for directory in abs_dirs:
value = abs_dirs[directory]
abs_dirs[directory] = value
dirs = {}