Beispiel #1
0
    def run(self, platform, productName, appVersion, version, build_number, locale, hashFunction, extVersion, buildID, **updateKwargs):
        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.suffix)
        locale_data = {"buildID": buildID, "appVersion": appVersion, "displayVersion": getPrettyVersion(version)}

        locale_data.update(self._get_update_data(productName, version, build_number, **updateKwargs))

        if self.backend_version == 2:
            log.info("Using backend version 2...")
            # XXX Check for existing data_version for this locale
            data = {
                "blob": {"platforms": {build_target: {"locales": {locale: locale_data}}}},
                # XXX old_data_versions here is currently required but shouldn't be
                "old_data_versions": {"platforms": {build_target: {"locales": {}}}},
            }
            url = self.api_root + "/v2/releases/" + name
            session = get_balrog_session(auth0_secrets=self.auth0_secrets)
            balrog_request(session, "post", url, json=data)
        else:
            log.info("Using legacy backend version...")
            api = SingleLocale(name=name, build_target=build_target, locale=locale, auth0_secrets=self.auth0_secrets, 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(locale_data), schemaVersion=9)
Beispiel #2
0
    def run(self, platform, productName, appVersion, version, build_number,
            locale, hashFunction, extVersion, buildID, **updateKwargs):
        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.suffix)
        data = {
            'buildID': buildID,
            'appVersion': appVersion,
            'displayVersion': getPrettyVersion(version)
        }

        data.update(
            self._get_update_data(productName, version, build_number,
                                  **updateKwargs))

        api = SingleLocale(name=name,
                           build_target=build_target,
                           locale=locale,
                           auth0_secrets=self.auth0_secrets,
                           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(data),
                         schemaVersion=9)
    def run(self, platform, productName, appVersion, version, build_number, locale,
            hashFunction, extVersion, buildID, **updateKwargs):
        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.suffix)
        data = {
            'buildID': buildID,
            'appVersion': appVersion,
            'displayVersion': getPrettyVersion(version)
        }

        data.update(self._get_update_data(productName, version, build_number,
                                          **updateKwargs))

        api = SingleLocale(name=name, build_target=build_target, locale=locale,
                           auth0_secrets=self.auth0_secrets,
                           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(data),
            schemaVersion=9)
Beispiel #4
0
    for partial in partials:
        # use the mar_diff.sh script to generate a partial mar
        subprocess.run(['bash', 'ci/mar_diff.sh', partial['toVersion'], join(args.mar_dir, partial['name']),
                        partial['from_mar'], partial['to_mar']])

elif args.action == 'publish':
    for partial in partials:
        build = SingleLocale(
            name=name, build_target=partial['platform'], locale=partial['locale'], **balrog_opts)
        update_url = f'{REPOSITORY_BASE_URL}/{args.to}/{partial["name"]}'
        mar_path = join(args.mar_dir, partial["name"])
        if not exists(mar_path):
            print(f'WARN: Skipping {mar_path} - NOT_FOUND')
            continue
        file_hash = get_file_hash(mar_path)
        build_data = build.get_data()[0]
        if 'partials' not in build_data:
            build_data['partials'] = []
        build_data['partials'].append({
            "from": from_release.name,
            "filesize": getsize(join(args.mar_dir, partial["name"])),
            "hashValue": file_hash,
            "fileUrl": update_url,
        })
        print(
            f'Add {partial["name"]} to {PRODUCT_NAME}-{partial["toVersion"]} ({from_release.name})')
        build.update_build(product=PRODUCT_NAME,
                           hashFunction='sha512',
                           buildData=json.dumps(build_data),
                           schemaVersion=9)