def add_build_dependency(config, job, taskdesc): """Add build dependency to the task description and installer_url to env.""" key = job['platform'] build_labels = config.config.get('dependent-build-platforms', {}) matches = keymatch(build_labels, key) if not matches: raise Exception( "No build platform found for '{}'. " "Define 'dependent-build-platforms' in the kind config.".format( key)) if len(matches) > 1: raise Exception( "More than one build platform found for '{}'.".format(key)) label = matches[0]['label'] target = matches[0]['target-name'] deps = taskdesc.setdefault('dependencies', {}) deps.update({'build': label}) build_artifact = 'public/build/{}'.format(target) installer_url = ARTIFACT_URL.format('<build>', build_artifact) env = taskdesc['worker'].setdefault('env', {}) env.update({'GECKO_INSTALLER_URL': {'task-reference': installer_url}})
def add_build_dependency(config, job): """ Add build dependency to the job and installer_url to env. """ key = job['platform'] build_labels = config.config.get('dependent-build-platforms', {}) matches = keymatch(build_labels, key) if not matches: raise Exception("No build platform found for '{}'. " "Define 'dependent-build-platforms' in the kind config.".format(key)) if len(matches) > 1: raise Exception("More than one build platform found for '{}'.".format(key)) label = matches[0] deps = job.setdefault('dependencies', {}) deps.update({'build': label})
def add_build_dependency(config, job): """ Add build dependency to the job and installer_url to env. """ key = job["platform"] build_labels = job.pop("require-build", {}) matches = keymatch(build_labels, key) if not matches: raise Exception( "No build platform found. " "Define 'require-build' for {} in the task config.".format(key) ) if len(matches) > 1: raise Exception("More than one build platform found for '{}'.".format(key)) label = matches[0] deps = job.setdefault("dependencies", {}) deps.update({"build": label})
def add_build_dependency(config, job, taskdesc): """Add build dependency to the task description and installer_url to env.""" key = job['platform'] build_labels = config.config.get('dependent-build-platforms', {}) matches = keymatch(build_labels, key) if not matches: raise Exception("No build platform found for '{}'. " "Define 'dependent-build-platforms' in the kind config.".format(key)) if len(matches) > 1: raise Exception("More than one build platform found for '{}'.".format(key)) label = matches[0]['label'] target = matches[0]['target-name'] deps = taskdesc.setdefault('dependencies', {}) deps.update({'build': label}) build_artifact = 'public/build/{}'.format(target) installer_url = ARTIFACT_URL.format('<build>', build_artifact) env = taskdesc['worker'].setdefault('env', {}) env.update({'GECKO_INSTALLER_URL': {'task-reference': installer_url}})