コード例 #1
0
ファイル: cli.py プロジェクト: B-Rich/build-tools
    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)
コード例 #2
0
ファイル: cli.py プロジェクト: kmaglione/build-tools
    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)
コード例 #3
0
ファイル: cli.py プロジェクト: B-Rich/build-tools
    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)
コード例 #4
0
ファイル: cli.py プロジェクト: imclab/build-tools
    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)
コード例 #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)
コード例 #6
0
ファイル: cli.py プロジェクト: seraphs/cssfixer
    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)
コード例 #7
0
ファイル: cli.py プロジェクト: magnyld/build-tools
 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)
コード例 #8
0
ファイル: cli.py プロジェクト: petemoore/build-tools
    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)
コード例 #9
0
ファイル: cli.py プロジェクト: imclab/build-tools
    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)
コード例 #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)
コード例 #11
0
ファイル: cli.py プロジェクト: IanConnolly/build-tools
    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)
コード例 #12
0
ファイル: cli.py プロジェクト: kmaglione/build-tools
    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,
            'appVersion': appVersion,
            'platformVersion': extVersion,
            'displayVersion': appVersion,
        }
        if isOSUpdate:
            data['isOSUpdate'] = isOSUpdate

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

        if 'old-id' in platform:
            # bug 1366034: support old-id builds
            # Like 1055305, this is a hack to support two builds with same build target that
            # require differed't release blobs and rules
            build_type = 'old-id-%s' % self.build_type
        else:
            build_type = self.build_type

        name = get_nightly_blob_name(productName, branch, build_type, buildID,
                                     self.dummy)
        api = SingleLocale(name=name,
                           build_target=build_target,
                           locale=locale,
                           auth=self.auth,
                           api_root=self.api_root)

        # wrap operations into "atomic" functions that can be retried
        def update_dated():
            current_data, data_version = api.get_data()
            # If the  partials are already a subset of the blob and the
            # complete MAR is the same, skip the submission
            skip_submission = bool(
                current_data
                and current_data.get("completes") == data.get("completes")
                and all(p in current_data.get("partials", [])
                        for p in data.get("partials", [])))
            if skip_submission:
                log.warn("Dated data didn't change, skipping update")
                return
            # explicitly pass data version
            api.update_build(product=productName,
                             hashFunction=hashFunction,
                             buildData=json.dumps(
                                 merge_partial_updates(current_data, data)),
                             alias=json.dumps(alias),
                             schemaVersion=schemaVersion,
                             data_version=data_version)

        # Most retries are caused by losing a data race. In these cases,
        # there's no point in waiting a long time to retry, so we reduce
        # sleeptime and increase the number of attempts instead.
        retry(update_dated, sleeptime=2, max_sleeptime=2, attempts=10)

        latest = SingleLocale(api_root=self.api_root,
                              auth=self.auth,
                              name=get_nightly_blob_name(
                                  productName, branch, build_type, 'latest',
                                  self.dummy),
                              build_target=build_target,
                              locale=locale)

        def update_latest():
            # copy everything over using target release's data version
            latest_data, latest_data_version = latest.get_data()
            source_data, _ = api.get_data()
            if source_data == latest_data:
                log.warn("Latest data didn't change, skipping update")
                return
            latest.update_build(product=productName,
                                hashFunction=hashFunction,
                                buildData=json.dumps(source_data),
                                alias=json.dumps(alias),
                                schemaVersion=schemaVersion,
                                data_version=latest_data_version)

        retry(update_latest, sleeptime=2, max_sleeptime=2, attempts=10)