Esempio n. 1
0
    def run(self, platform, buildID, productName, branch, appVersion, locale,
            hashFunction, extVersion, schemaVersion, isOSUpdate=None, **updateKwargs):
        assert schemaVersion in (2, 3), 'Unhandled schema version %s' % schemaVersion
        targets = buildbot2updatePlatforms(platform)
        build_target = targets[0]
        alias = None
        if len(targets) > 1:
            alias = targets[1:]

        data = {
            'buildID': buildID,
        }
        data['appVersion'] = appVersion
        data['platformVersion'] = extVersion
        data['displayVersion'] = appVersion
        if isOSUpdate:
            data['isOSUpdate'] = isOSUpdate

        data.update(self._get_update_data(productName, branch, **updateKwargs))

        name = get_nightly_blob_name(productName, branch, self.build_type, buildID, self.dummy)
        data = json.dumps(data)
        api = SingleLocale(auth=self.auth, api_root=self.api_root)
        copyTo = [get_nightly_blob_name(
            productName, branch, self.build_type, 'latest', self.dummy)]
        copyTo = json.dumps(copyTo)
        alias = json.dumps(alias)
        api.update_build(name=name, product=productName,
                         build_target=build_target,
                         version=appVersion, locale=locale,
                         hashFunction=hashFunction,
                         buildData=data, copyTo=copyTo, alias=alias,
                         schemaVersion=schemaVersion)
Esempio n. 2
0
    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)
Esempio n. 3
0
    def run(self, platform, productName, appVersion, version, build_number, locale,
            hashFunction, extVersion, buildID, completeMarSize, completeMarHash):
        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 = {
            'appv': appVersion,
            'extv': extVersion,
            'buildID': buildID,
        }
        data['complete'] = {
            'from': '*',
            'filesize': completeMarSize,
            'hashValue': completeMarHash,
        }

        data = json.dumps(data)
        api = SingleLocale(auth=self.auth, api_root=self.api_root)
        api.update_build(name=name, product=productName,
                         build_target=build_target, version=appVersion,
                         locale=locale, hashFunction=hashFunction,
                         buildData=data)
Esempio n. 4
0
    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)
Esempio n. 5
0
    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)
Esempio n. 6
0
    def run(self, platform, buildID, productName, branch, appVersion, locale,
            hashFunction, extVersion, completeMarSize, completeMarHash,
            completeMarUrl, schemaVersion, isOSUpdate=None, partialMarSize=None,
            partialMarHash=None, partialMarUrl=None, previous_buildid=None):
        targets = buildbot2updatePlatforms(platform)
        build_target = targets[0]
        alias = None
        if len(targets) > 1:
            alias = targets[1:]

        name = get_nightly_blob_name(productName, branch, self.build_type, buildID, 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'] = appVersion
            if isOSUpdate:
                data['isOSUpdate'] = isOSUpdate

        data['complete'] = {
            'from': '*',
            'filesize': completeMarSize,
            'hashValue': completeMarHash,
            'fileUrl': completeMarUrl
        }
        if partialMarSize:
            data['partial'] = {
                'from': get_nightly_blob_name(productName, branch,
                                              self.build_type,
                                              previous_buildid,
                                              self.dummy),
                'filesize': partialMarSize,
                'hashValue': partialMarHash,
                'fileUrl': partialMarUrl
            }

        data = json.dumps(data)
        api = SingleLocale(auth=self.auth, api_root=self.api_root)
        copyTo = [get_nightly_blob_name(
            productName, branch, self.build_type, 'latest', self.dummy)]
        copyTo = json.dumps(copyTo)
        alias = json.dumps(alias)
        schemaVersion = json.dumps(schemaVersion)
        api.update_build(name=name, product=productName,
                         build_target=build_target,
                         version=appVersion, locale=locale,
                         hashFunction=hashFunction,
                         buildData=data, copyTo=copyTo, alias=alias,
                         schemaVersion=schemaVersion)
Esempio n. 7
0
 def run(self):
     data = self.generate_data()
     data = json.dumps(data)
     api = SingleLocale(auth=self.auth, api_root=self.api_root)
     copyTo = [get_nightly_blob_name(
         self.appName, self.branch, self.build_type, 'latest', self.dummy)]
     copyTo = json.dumps(copyTo)
     alias = json.dumps(self.alias)
     api.update_build(name=self.name, product=self.appName,
                      build_target=self.build_target,
                      version=self.appVersion, locale=self.locale,
                      hashFunction=self.hashFunction,
                      buildData=data, copyTo=copyTo, alias=alias)
Esempio n. 8
0
    def run(self, platform, buildID, productName, branch, appVersion, locale,
            hashFunction, extVersion, schemaVersion, isOSUpdate=None, **updateKwargs):
        assert schemaVersion in (3,4), 'Unhandled schema version %s' % schemaVersion
        targets = buildbot2updatePlatforms(platform)
        build_target = targets[0]
        alias = None
        if len(targets) > 1:
            alias = targets[1:]

        data = {
            'buildID': buildID,
        }
        data['appVersion'] = appVersion
        data['platformVersion'] = extVersion
        data['displayVersion'] = appVersion
        if isOSUpdate:
            data['isOSUpdate'] = isOSUpdate

        data.update(self._get_update_data(productName, branch, **updateKwargs))

        if build_target == 'flame-kk':
            # Bug 1055305 - a hack so that we can have JB and KK OTA for flame.
            # They both query with buildTarget of flame, but differ in OS Version,
            # so we need separate release blobs and rule to do the right thing
            build_type = 'kitkat-%s' % self.build_type
        elif platform == 'android-api-9':
            # Bug 1080749 - a hack to support api-9 and api-10+ split builds.
            # Like 1055305 above, this is a hack to support two builds with same build target that
            # require differed't release blobs and rules
            build_type = 'api-9-%s' % self.build_type
        else:
            build_type = self.build_type

        name = get_nightly_blob_name(productName, branch, build_type, buildID, self.dummy)
        data = json.dumps(data)
        api = SingleLocale(auth=self.auth, api_root=self.api_root)
        copyTo = [get_nightly_blob_name(
            productName, branch, build_type, 'latest', self.dummy)]
        copyTo = json.dumps(copyTo)
        alias = json.dumps(alias)
        api.update_build(name=name, product=productName,
                         build_target=build_target,
                         version=appVersion, locale=locale,
                         hashFunction=hashFunction,
                         buildData=data, copyTo=copyTo, alias=alias,
                         schemaVersion=schemaVersion)
Esempio n. 9
0
    def run(self, platform, buildID, productName, branch, appVersion, locale,
            hashFunction, extVersion, completeMarSize, completeMarHash,
            completeMarUrl, partialMarSize, partialMarHash=None,
            partialMarUrl=None, previous_buildid=None):
        targets = buildbot2updatePlatforms(platform)
        build_target = targets[0]
        alias = None
        if len(targets) > 1:
            alias = targets[1:]

        name = get_nightly_blob_name(productName, branch, self.build_type, buildID, self.dummy)
        data = {
            'appv': appVersion,
            'extv': extVersion,
            'buildID': buildID,
        }
        data['complete'] = {
            'from': '*',
            'filesize': completeMarSize,
            'hashValue': completeMarHash,
            'fileUrl': completeMarUrl
        }
        if partialMarSize:
            data['partial'] = {
                'from': get_nightly_blob_name(productName, branch,
                                              self.build_type,
                                              previous_buildid,
                                              self.dummy),
                'filesize': partialMarSize,
                'hashValue': partialMarHash,
                'fileUrl': partialMarUrl
            }

        data = json.dumps(data)
        api = SingleLocale(auth=self.auth, api_root=self.api_root)
        copyTo = [get_nightly_blob_name(
            productName, branch, self.build_type, 'latest', self.dummy)]
        copyTo = json.dumps(copyTo)
        alias = json.dumps(alias)
        api.update_build(name=name, product=productName,
                         build_target=build_target,
                         version=appVersion, locale=locale,
                         hashFunction=hashFunction,
                         buildData=data, copyTo=copyTo, alias=alias)
Esempio n. 10
0
    def run(self, platform, buildID, productName, branch, appVersion, locale,
            hashFunction, extVersion, schemaVersion, isOSUpdate=None, **updateKwargs):
        assert schemaVersion in (2, 3), 'Unhandled schema version %s' % schemaVersion
        targets = buildbot2updatePlatforms(platform)
        build_target = targets[0]
        alias = None
        if len(targets) > 1:
            alias = targets[1:]

        data = {
            'buildID': buildID,
        }
        data['appVersion'] = appVersion
        data['platformVersion'] = extVersion
        data['displayVersion'] = appVersion
        if isOSUpdate:
            data['isOSUpdate'] = isOSUpdate

        data.update(self._get_update_data(productName, branch, **updateKwargs))

        # Bug 1055305 - a hack so that we can have JB and KK OTA for flame.
        # They both query with buildTarget of flame, but differ in OS Version,
        # so we need separate release blobs and rule to do the right thing
        build_type = self.build_type
        if build_target == 'flame-kk':
            build_type = 'kitkat-%s' % build_type

        name = get_nightly_blob_name(productName, branch, build_type, buildID, self.dummy)
        data = json.dumps(data)
        api = SingleLocale(auth=self.auth, api_root=self.api_root)
        copyTo = [get_nightly_blob_name(
            productName, branch, build_type, 'latest', self.dummy)]
        copyTo = json.dumps(copyTo)
        alias = json.dumps(alias)
        api.update_build(name=name, product=productName,
                         build_target=build_target,
                         version=appVersion, locale=locale,
                         hashFunction=hashFunction,
                         buildData=data, copyTo=copyTo, alias=alias,
                         schemaVersion=schemaVersion)
Esempio n. 11
0
    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)