def run(self, platform, productName, appVersion, version, build_number, locale, hashFunction, extVersion, buildID, schemaVersion, **updateKwargs): assert schemaVersion in (2, 3), 'Unhandled schema version %s' % schemaVersion targets = buildbot2updatePlatforms(platform) # Some platforms may have alias', but those are set-up elsewhere # for release blobs. build_target = targets[0] name = get_release_blob_name(productName, version, build_number, self.dummy) data = { 'buildID': buildID, } data['appVersion'] = appVersion data['platformVersion'] = extVersion data['displayVersion'] = getPrettyVersion(version) data.update(self._get_update_data(productName, version, build_number, **updateKwargs)) data = json.dumps(data) api = SingleLocale(auth=self.auth, api_root=self.api_root) schemaVersion = json.dumps(schemaVersion) api.update_build(name=name, product=productName, build_target=build_target, version=appVersion, locale=locale, hashFunction=hashFunction, buildData=data, schemaVersion=schemaVersion)
def generate_data(self, appVersion, productName, version, buildNumber, updateChannels, ftpServer, bouncerServer, enUSPlatforms, schemaVersion, openURL=None, **updateKwargs): assert schemaVersion in ( 3, 4), 'Unhandled schema version %s' % schemaVersion details_product = productName.lower() if details_product == "devedition": details_product = "firefox" data = { 'detailsUrl': getProductDetails(details_product, appVersion), 'platforms': {}, 'fileUrls': {}, 'appVersion': appVersion, 'platformVersion': appVersion, 'displayVersion': getPrettyVersion(version) } actions = [] if openURL: actions.append("showURL") data["openURL"] = openURL if actions: data["actions"] = " ".join(actions) fileUrls = self._getFileUrls(productName, version, buildNumber, updateChannels, ftpServer, bouncerServer, **updateKwargs) if fileUrls: data.update(fileUrls) updateData = self._get_update_data(productName, version, **updateKwargs) if updateData: data.update(updateData) for platform in enUSPlatforms: updatePlatforms = buildbot2updatePlatforms(platform) bouncerPlatform = buildbot2bouncer(platform) ftpPlatform = buildbot2ftp(platform) data['platforms'][updatePlatforms[0]] = { 'OS_BOUNCER': bouncerPlatform, 'OS_FTP': ftpPlatform } for aliasedPlatform in updatePlatforms[1:]: data['platforms'][aliasedPlatform] = { 'alias': updatePlatforms[0] } return data
def add_locations(self): for platform in self.platforms: template_dict = { 'product': self.productName, 'brandName': self.brandName, 'bouncer_product': self.bouncerProductName, 'version': self.version, 'milestone': self.milestone, 'prettyVersion': getPrettyVersion(self.version), 'old_version': self.oldVersion, 'ftp_platform': buildbot2ftp(platform), 'locale': ':lang' } # Full product path = self.full_product_template[platform] % template_dict self.location_add(self.bouncer_product_name, platform, path) # Complete MAR product if self.addMARs: path = self.complete_mar_template[platform] % template_dict self.location_add(self.complete_mar_bouncer_product_name, platform, path) # Partial MAR product if self.oldVersion: path = self.partial_mar_template[platform] % template_dict self.location_add(self.partial_mar_bouncer_product_name, platform, path)
def run(self, platform, productName, appVersion, version, build_number, locale, hashFunction, extVersion, buildID, schemaVersion, **updateKwargs): assert schemaVersion in ( 3, 4), 'Unhandled schema version %s' % schemaVersion targets = buildbot2updatePlatforms(platform) # Some platforms may have alias', but those are set-up elsewhere # for release blobs. build_target = targets[0] name = get_release_blob_name(productName, version, build_number, self.dummy) data = { 'buildID': buildID, 'appVersion': appVersion, 'platformVersion': extVersion, 'displayVersion': getPrettyVersion(version) } data.update( self._get_update_data(productName, version, build_number, **updateKwargs)) api = SingleLocale(name=name, build_target=build_target, locale=locale, auth=self.auth, api_root=self.api_root) current_data, data_version = api.get_data() api.update_build(data_version=data_version, product=productName, hashFunction=hashFunction, buildData=json.dumps( merge_partial_updates(current_data, data)), schemaVersion=schemaVersion)
def add_locations(self): for platform in self.platforms: template_dict = {'product': self.productName, 'brandName': self.brandName, 'bouncer_product': self.bouncerProductName, 'version': self.version, 'milestone': self.milestone, 'prettyVersion': getPrettyVersion(self.version), 'ftp_platform': buildbot2ftp(platform), 'locale': ':lang'} # Full product path = self.full_product_template[platform] % template_dict self.location_add(self.bouncer_product_name, platform, path) # Complete MAR product if self.addMARs: path = self.complete_mar_template[platform] % template_dict self.location_add(self.complete_mar_bouncer_product_name, platform, path) # Partial MAR product for previousVersion in self.partialVersions: template_dict['previous_version'] = previousVersion path = self.partial_mar_template[platform] % template_dict name = self.partial_mar_bouncer_product_names[ previousVersion] self.location_add(name, platform, path)
def generate_data(self, appVersion, productName, version, buildNumber, updateChannels, stagingServer, bouncerServer, enUSPlatforms, schemaVersion, **updateKwargs): assert schemaVersion in (2, 3), 'Unhandled schema version %s' % schemaVersion self.name = get_release_blob_name(productName, version, buildNumber) data = { 'name': self.name, 'detailsUrl': getProductDetails(productName.lower(), appVersion), 'platforms': {}, 'fileUrls': {}, 'ftpFilenames': {}, 'bouncerProducts': {}, } data['appVersion'] = appVersion data['platformVersion'] = appVersion data['displayVersion'] = getPrettyVersion(version) # XXX: This is a hack for bug 1045583. We should remove it, and always # use "candidates" for nightlyDir after the switch to Balrog is complete. if productName.lower() == "mobile": nightlyDir = "candidates" else: nightlyDir = "nightly" for channel in updateChannels: if channel in ('betatest', 'esrtest') or "localtest" in channel: dir_ = makeCandidatesDir(productName.lower(), version, buildNumber, server=stagingServer, protocol='http', nightlyDir=nightlyDir) data['fileUrls'][channel] = '%supdate/%%OS_FTP%%/%%LOCALE%%/%%FILENAME%%' % dir_ else: url = 'http://%s/?product=%%PRODUCT%%&os=%%OS_BOUNCER%%&lang=%%LOCALE%%' % bouncerServer data['fileUrls'][channel] = url # XXX: quick hack for bug 1021026. We should be using Bouncer for this # after we implement better solution talked about in comments 2 through 4 if channel == 'release': dir_ = makeCandidatesDir(productName.lower(), version, buildNumber, server='download.cdn.mozilla.net', protocol='http', nightlyDir=nightlyDir) url = '%supdate/%%OS_FTP%%/%%LOCALE%%/%%FILENAME%%' % dir_ data['fileUrls']['beta'] = url data['fileUrls']['beta-cdntest'] = url data.update(self._get_update_data(productName, version, **updateKwargs)) for platform in enUSPlatforms: updatePlatforms = buildbot2updatePlatforms(platform) bouncerPlatform = buildbot2bouncer(platform) ftpPlatform = buildbot2ftp(platform) data['platforms'][updatePlatforms[0]] = { 'OS_BOUNCER': bouncerPlatform, 'OS_FTP': ftpPlatform } for aliasedPlatform in updatePlatforms[1:]: data['platforms'][aliasedPlatform] = { 'alias': updatePlatforms[0] } return data
def generate_data(self, appVersion, productName, version, buildNumber, partialUpdates, updateChannels, stagingServer, bouncerServer, enUSPlatforms, schemaVersion): # TODO: Multiple partial support. Probably as a part of bug 797033. previousVersion = str(max(StrictVersion(v) for v in partialUpdates)) self.name = get_release_blob_name(productName, version, buildNumber) data = { 'name': self.name, 'detailsUrl': getProductDetails(productName.lower(), appVersion), 'platforms': {}, 'fileUrls': {}, 'ftpFilenames': {}, 'bouncerProducts': {}, } assert schemaVersion in (1, 2), 'Unhandled schema version %s' % schemaVersion if schemaVersion == 1: data['appv'] = appVersion data['extv'] = appVersion elif schemaVersion == 2: data['appVersion'] = appVersion data['platformVersion'] = appVersion data['displayVersion'] = getPrettyVersion(version) for channel in updateChannels: if channel in ('betatest', 'esrtest'): dir_ = makeCandidatesDir(productName.lower(), version, buildNumber, server=stagingServer, protocol='http') data['fileUrls'][channel] = '%supdate/%%OS_FTP%%/%%LOCALE%%/%%FILENAME%%' % dir_ else: url = 'http://%s/?product=%%PRODUCT%%&os=%%OS_BOUNCER%%&lang=%%LOCALE%%' % bouncerServer data['fileUrls'][channel] = url data['ftpFilenames']['complete'] = '%s-%s.complete.mar' % (productName.lower(), version) data['ftpFilenames']['partial'] = '%s-%s-%s.partial.mar' % (productName.lower(), previousVersion, version) data['bouncerProducts']['complete'] = '%s-%s-Complete' % (productName.capitalize(), version) data['bouncerProducts']['partial'] = '%s-%s-Partial-%s' % (productName.capitalize(), version, previousVersion) for platform in enUSPlatforms: updatePlatforms = buildbot2updatePlatforms(platform) bouncerPlatform = buildbot2bouncer(platform) ftpPlatform = buildbot2ftp(platform) data['platforms'][updatePlatforms[0]] = { 'OS_BOUNCER': bouncerPlatform, 'OS_FTP': ftpPlatform } for aliasedPlatform in updatePlatforms[1:]: data['platforms'][aliasedPlatform] = { 'alias': updatePlatforms[0] } return data
def generate_data(self, appVersion, productName, version, buildNumber, updateChannels, ftpServer, bouncerServer, enUSPlatforms, **updateKwargs): details_product = productName.lower() if details_product == "devedition": details_product = "firefox" data = { 'platforms': {}, 'fileUrls': {}, 'appVersion': appVersion, 'displayVersion': getPrettyVersion(version), 'updateLine': [ { 'for': {}, 'fields': { 'detailsURL': getProductDetails(details_product, appVersion), 'type': 'minor', }, }, ] } actions = [] fileUrls = self._getFileUrls(productName, version, buildNumber, updateChannels, ftpServer, bouncerServer, **updateKwargs) if fileUrls: data.update(fileUrls) for platform in enUSPlatforms: updatePlatforms = buildbot2updatePlatforms(platform) bouncerPlatform = buildbot2bouncer(platform) ftpPlatform = buildbot2ftp(platform) data['platforms'][updatePlatforms[0]] = { 'OS_BOUNCER': bouncerPlatform, 'OS_FTP': ftpPlatform } for aliasedPlatform in updatePlatforms[1:]: data['platforms'][aliasedPlatform] = { 'alias': updatePlatforms[0] } return data
def generate_data(self, appVersion, productName, version, buildNumber, updateChannels, ftpServer, bouncerServer, enUSPlatforms, schemaVersion, openURL=None, **updateKwargs): assert schemaVersion in ( 3, 4), 'Unhandled schema version %s' % schemaVersion data = { 'detailsUrl': getProductDetails(productName.lower(), appVersion), 'platforms': {}, 'fileUrls': {}, 'appVersion': appVersion, 'platformVersion': appVersion, 'displayVersion': getPrettyVersion(version) } actions = [] if openURL: actions.append("showURL") data["openURL"] = openURL if actions: data["actions"] = " ".join(actions) fileUrls = self._getFileUrls(productName, version, buildNumber, updateChannels, ftpServer, bouncerServer, **updateKwargs) if fileUrls: data.update(fileUrls) updateData = self._get_update_data( productName, version, **updateKwargs) if updateData: data.update(updateData) for platform in enUSPlatforms: updatePlatforms = buildbot2updatePlatforms(platform) bouncerPlatform = buildbot2bouncer(platform) ftpPlatform = buildbot2ftp(platform) data['platforms'][updatePlatforms[0]] = { 'OS_BOUNCER': bouncerPlatform, 'OS_FTP': ftpPlatform } for aliasedPlatform in updatePlatforms[1:]: data['platforms'][aliasedPlatform] = { 'alias': updatePlatforms[0] } return data
def generate_data(self, appVersion, productName, version, buildNumber, updateChannels, stagingServer, bouncerServer, enUSPlatforms, schemaVersion, **updateKwargs): assert schemaVersion in (2, 3), 'Unhandled schema version %s' % schemaVersion self.name = get_release_blob_name(productName, version, buildNumber) data = { 'name': self.name, 'detailsUrl': getProductDetails(productName.lower(), appVersion), 'platforms': {}, 'fileUrls': {}, 'ftpFilenames': {}, 'bouncerProducts': {}, } data['appVersion'] = appVersion data['platformVersion'] = appVersion data['displayVersion'] = getPrettyVersion(version) for channel in updateChannels: if channel in ('betatest', 'esrtest'): dir_ = makeCandidatesDir(productName.lower(), version, buildNumber, server=stagingServer, protocol='http') data['fileUrls'][channel] = '%supdate/%%OS_FTP%%/%%LOCALE%%/%%FILENAME%%' % dir_ else: url = 'http://%s/?product=%%PRODUCT%%&os=%%OS_BOUNCER%%&lang=%%LOCALE%%' % bouncerServer data['fileUrls'][channel] = url data.update(self._get_update_data(productName, version, **updateKwargs)) for platform in enUSPlatforms: updatePlatforms = buildbot2updatePlatforms(platform) bouncerPlatform = buildbot2bouncer(platform) ftpPlatform = buildbot2ftp(platform) data['platforms'][updatePlatforms[0]] = { 'OS_BOUNCER': bouncerPlatform, 'OS_FTP': ftpPlatform } for aliasedPlatform in updatePlatforms[1:]: data['platforms'][aliasedPlatform] = { 'alias': updatePlatforms[0] } return data
def run(self, platform, productName, appVersion, version, build_number, locale, hashFunction, extVersion, buildID, completeMarSize, completeMarHash, schemaVersion=2): targets = buildbot2updatePlatforms(platform) # Some platforms may have alias', but those are set-up elsewhere # for release blobs. build_target = targets[0] name = get_release_blob_name(productName, version, build_number, self.dummy) data = { 'buildID': buildID, } assert schemaVersion in (1, 2), 'Unhandled schema version %s' % schemaVersion if schemaVersion == 1: data['appv'] = appVersion data['extv'] = extVersion elif schemaVersion == 2: data['appVersion'] = appVersion data['platformVersion'] = extVersion data['displayVersion'] = getPrettyVersion(version) data['complete'] = { 'from': '*', 'filesize': completeMarSize, 'hashValue': completeMarHash, } data = json.dumps(data) api = SingleLocale(auth=self.auth, api_root=self.api_root) schemaVersion = json.dumps(schemaVersion) api.update_build(name=name, product=productName, build_target=build_target, version=appVersion, locale=locale, hashFunction=hashFunction, buildData=data, schemaVersion=schemaVersion)
def generate_data(self, appVersion, productName, version, buildNumber, updateChannels, stagingServer, bouncerServer, enUSPlatforms, schemaVersion, openURL=None, **updateKwargs): assert schemaVersion in (2, 3), 'Unhandled schema version %s' % schemaVersion self.name = get_release_blob_name(productName, version, buildNumber) data = { 'name': self.name, 'detailsUrl': getProductDetails(productName.lower(), appVersion), 'platforms': {}, 'fileUrls': {}, 'ftpFilenames': {}, 'bouncerProducts': {}, } data['appVersion'] = appVersion data['platformVersion'] = appVersion data['displayVersion'] = getPrettyVersion(version) actions = [] if openURL: actions.append("showURL") data["openURL"] = openURL if actions: data["actions"] = " ".join(actions) # XXX: This is a hack for bug 1045583. We should remove it, and always # use "candidates" for nightlyDir after the switch to Balrog is complete. if productName.lower() == "mobile": nightlyDir = "candidates" else: nightlyDir = "nightly" for channel in updateChannels: if channel in ('betatest', 'esrtest') or "localtest" in channel: dir_ = makeCandidatesDir(productName.lower(), version, buildNumber, server=stagingServer, protocol='http', nightlyDir=nightlyDir) data['fileUrls'][channel] = '%supdate/%%OS_FTP%%/%%LOCALE%%/%%FILENAME%%' % dir_ else: url = 'http://%s/?product=%%PRODUCT%%&os=%%OS_BOUNCER%%&lang=%%LOCALE%%' % bouncerServer data['fileUrls'][channel] = url # XXX: quick hack for bug 1021026. We should be using Bouncer for this # after we implement better solution talked about in comments 2 through 4 if channel == 'release': dir_ = makeCandidatesDir(productName.lower(), version, buildNumber, server='download.cdn.mozilla.net', protocol='http', nightlyDir=nightlyDir) url = '%supdate/%%OS_FTP%%/%%LOCALE%%/%%FILENAME%%' % dir_ data['fileUrls']['beta'] = url data['fileUrls']['beta-cdntest'] = url data.update(self._get_update_data(productName, version, **updateKwargs)) for platform in enUSPlatforms: updatePlatforms = buildbot2updatePlatforms(platform) bouncerPlatform = buildbot2bouncer(platform) ftpPlatform = buildbot2ftp(platform) data['platforms'][updatePlatforms[0]] = { 'OS_BOUNCER': bouncerPlatform, 'OS_FTP': ftpPlatform } for aliasedPlatform in updatePlatforms[1:]: data['platforms'][aliasedPlatform] = { 'alias': updatePlatforms[0] } return data