예제 #1
0
 def location_add(self, product, platform, path):
     path = path.replace(' ', '%20')
     if self.verbose:
         print "Adding location for %s, %s: %s" % \
             (product, buildbot2bouncer(platform), path)
     self.tuxedoRequest("location_add/",
                        {'product': product,
                         'os': buildbot2bouncer(platform),
                         'path': path})
예제 #2
0
    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
예제 #3
0
    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
예제 #4
0
파일: cli.py 프로젝트: seraphs/cssfixer
    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
예제 #5
0
def get_release_uptake(tuxedoServerUrl,
                       bouncerProductName,
                       version,
                       platforms,
                       partialVersions=None,
                       checkMARs=True,
                       username=None,
                       password=None):
    assert isinstance(platforms, (list, tuple))
    bouncerProduct = generateBouncerProduct(bouncerProductName, version)
    bouncerCompleteMARProduct = generateBouncerProduct(
        bouncerProductName, version, productType=PRODUCT_COMPLETE_MAR)
    bouncerPartialMARProducts = []
    for previousVersion in partialVersions:
        bouncerPartialMARProducts.append(
            generateBouncerProduct(bouncerProductName,
                                   version,
                                   previousVersion,
                                   productType=PRODUCT_PARTIAL_MAR))
    dl = []

    for os in [buildbot2bouncer(x) for x in platforms]:
        dl.append(
            get_product_uptake(tuxedoServerUrl=tuxedoServerUrl,
                               bouncerProductName=bouncerProduct,
                               username=username,
                               os=os,
                               password=password))
        if checkMARs:
            dl.append(
                get_product_uptake(
                    tuxedoServerUrl=tuxedoServerUrl,
                    os=os,
                    bouncerProductName=bouncerCompleteMARProduct,
                    username=username,
                    password=password))
            for product in bouncerPartialMARProducts:
                dl.append(
                    get_product_uptake(tuxedoServerUrl=tuxedoServerUrl,
                                       os=os,
                                       bouncerProductName=product,
                                       username=username,
                                       password=password))

    def get_min(res):
        return min([int(x[1]) for x in res])

    dl = defer.DeferredList(dl, fireOnOneErrback=True)
    dl.addCallback(get_min)
    return dl
예제 #6
0
파일: cli.py 프로젝트: danyu803/build-tools
    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
예제 #7
0
    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
예제 #8
0
파일: cli.py 프로젝트: B-Rich/build-tools
    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
예제 #9
0
def get_release_uptake(tuxedoServerUrl, bouncerProductName, version,
                       platforms, partialVersions=None, checkMARs=True,
                       checkInstallers=True, username=None, password=None):
    assert isinstance(platforms, (list, tuple))
    if not checkMARs and not checkInstallers:
        raise ValueError("One of checkMars or checkInstallers must be true. Cannot check uptake of nothing!")
    bouncerProduct = generateBouncerProduct(bouncerProductName, version)
    bouncerCompleteMARProduct = generateBouncerProduct(
        bouncerProductName,
        version,
        productType=PRODUCT_COMPLETE_MAR)
    bouncerPartialMARProducts = []
    for previousVersion in partialVersions:
        bouncerPartialMARProducts.append(generateBouncerProduct(
            bouncerProductName, version,
            previousVersion,
            productType=PRODUCT_PARTIAL_MAR))
    dl = []

    for os in [buildbot2bouncer(x) for x in platforms]:
        if checkInstallers:
            dl.append(get_product_uptake(tuxedoServerUrl=tuxedoServerUrl,
                                        bouncerProductName=bouncerProduct,
                                        username=username, os=os,
                                        password=password))
        if checkMARs:
            dl.append(get_product_uptake(
                tuxedoServerUrl=tuxedoServerUrl,
                os=os, bouncerProductName=bouncerCompleteMARProduct,
                username=username, password=password))
            for product in bouncerPartialMARProducts:
                dl.append(get_product_uptake(
                    tuxedoServerUrl=tuxedoServerUrl, os=os,
                    bouncerProductName=product,
                    username=username, password=password))

    def get_min(res):
        return min([int(x[1]) for x in res])

    dl = defer.DeferredList(dl, fireOnOneErrback=True)
    dl.addCallback(get_min)
    return dl
예제 #10
0
파일: tuxedo.py 프로젝트: EkkiD/build-tools
def get_release_uptake(tuxedoServerUrl, bouncerProductName, version,
                       platforms, oldVersion=None, checkMARs=True,
                       username=None, password=None):
    assert isinstance(platforms, (list, tuple))
    bouncerProduct = generateBouncerProduct(bouncerProductName, version)
    bouncerCompleteMARProduct = generateBouncerProduct(
        bouncerProductName,
        version,
        productType=PRODUCT_COMPLETE_MAR)
    bouncerPartialMARProduct = generateBouncerProduct(
        bouncerProductName, version,
        oldVersion,
        productType=PRODUCT_PARTIAL_MAR)
    dl = []

    for os in [buildbot2bouncer(x) for x in platforms]:
        dl.append(get_product_uptake(tuxedoServerUrl=tuxedoServerUrl,
                            bouncerProductName=bouncerProduct,
                            username=username, os=os,
                            password=password))
        if checkMARs:
            dl.append(get_product_uptake(
                tuxedoServerUrl=tuxedoServerUrl,
                os=os, bouncerProductName=bouncerCompleteMARProduct,
                username=username, password=password))
            if oldVersion:
                dl.append(get_product_uptake(
                    tuxedoServerUrl=tuxedoServerUrl, os=os,
                    bouncerProductName=bouncerPartialMARProduct,
                    username=username, password=password))

    def get_min(res):
        return min([int(x[1]) for x in res])

    dl = defer.DeferredList(dl, fireOnOneErrback=True)
    dl.addCallback(get_min)
    return dl
예제 #11
0
    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