예제 #1
0
def make_task_worker(config, jobs):
    for job in jobs:
        locale = job["attributes"].get("locale")
        platform = job["attributes"]["build_platform"]

        worker = {
            'implementation':
            'beetmover',
            'release-properties':
            craft_release_properties(config, job),
            'upstream-artifacts':
            generate_beetmover_upstream_artifacts(config, job, platform,
                                                  locale),
            'artifact-map':
            generate_beetmover_artifact_map(config,
                                            job,
                                            platform=platform,
                                            locale=locale)
        }

        if locale:
            worker["locale"] = locale
        job["worker"] = worker

        yield job
예제 #2
0
파일: beetmover.py 프로젝트: ci/gecko-dev
def make_task_worker(config, jobs):
    for job in jobs:
        valid_beetmover_job = (len(job["dependencies"]) == 2 and any(
            ['signing' in j for j in job['dependencies']]))
        # XXX release snap-repackage has a variable number of dependencies, depending on how many
        # "post-beetmover-dummy" jobs there are in the graph.
        if '-snap-' not in job['label'] and not valid_beetmover_job:
            raise NotImplementedError("Beetmover must have two dependencies.")

        locale = job["attributes"].get("locale")
        platform = job["attributes"]["build_platform"]

        worker = {
            'implementation':
            'beetmover',
            'release-properties':
            craft_release_properties(config, job),
            'upstream-artifacts':
            generate_beetmover_upstream_artifacts(config, job, platform,
                                                  locale),
            'artifact-map':
            generate_beetmover_artifact_map(config,
                                            job,
                                            platform=platform,
                                            locale=locale),
        }

        if locale:
            worker["locale"] = locale
        job["worker"] = worker

        yield job
예제 #3
0
def make_task_worker(config, jobs):
    for job in jobs:
        locale = job["attributes"].get("locale")
        platform = job["attributes"]["build_platform"]

        if should_use_artifact_map(platform):
            upstream_artifacts = generate_beetmover_upstream_artifacts(
                config, job, platform, locale)
        else:
            upstream_artifacts = generate_upstream_artifacts(
                config, job, job['dependencies'], platform, locale,
                project=config.params['project']
            )

        worker = {
            'implementation': 'beetmover',
            'release-properties': craft_release_properties(config, job),
            'upstream-artifacts': upstream_artifacts,
        }

        if should_use_artifact_map(platform):
            worker['artifact-map'] = generate_beetmover_artifact_map(
                config, job, platform=platform, locale=locale)

        if locale:
            worker["locale"] = locale
        job["worker"] = worker

        yield job
예제 #4
0
def make_task_worker(config, jobs):
    for job in jobs:
        valid_beetmover_job = (len(job["dependencies"]) == 2 and any(
            ['signing' in j for j in job['dependencies']]))
        if not valid_beetmover_job:
            raise NotImplementedError("Beetmover must have two dependencies.")

        platform = job["attributes"]["build_platform"]
        worker = {
            'implementation':
            'beetmover',
            'release-properties':
            craft_release_properties(config, job),
            'upstream-artifacts':
            generate_beetmover_upstream_artifacts(config,
                                                  job,
                                                  platform=None,
                                                  locale=None),
            'artifact-map':
            generate_beetmover_artifact_map(config, job, platform=platform),
        }

        job["worker"] = worker

        yield job
예제 #5
0
def make_task_worker(config, jobs):
    for job in jobs:
        signing_task_ref = get_upstream_task_ref(
            job, expected_kinds=('release-sign-and-push-langpacks', ))

        platform = job["attributes"]["build_platform"]
        locale = job["attributes"]["chunk_locales"]
        if should_use_artifact_map(platform):
            upstream_artifacts = generate_beetmover_upstream_artifacts(
                config,
                job,
                platform,
                locale,
            )
        else:
            upstream_artifacts = generate_upstream_artifacts(
                signing_task_ref, job['attributes']['chunk_locales'])
        job['worker'] = {
            'implementation': 'beetmover',
            'release-properties': craft_release_properties(config, job),
            'upstream-artifacts': upstream_artifacts,
        }

        if should_use_artifact_map(platform):
            job['worker']['artifact-map'] = generate_beetmover_artifact_map(
                config, job, platform=platform, locale=locale)

        yield job
예제 #6
0
def make_beetmover_checksums_worker(config, jobs):
    for job in jobs:
        locale = job["attributes"].get("locale")
        platform = job["attributes"]["build_platform"]

        refs = {
            "signing": "<checksums-signing>",
        }

        worker = {
            'implementation': 'beetmover',
            'release-properties': craft_release_properties(config, job),
        }

        if should_use_artifact_map(platform, config.params['project']):
            upstream_artifacts = generate_beetmover_upstream_artifacts(
                job, platform, locale
            )
            worker['artifact-map'] = generate_beetmover_artifact_map(
                config, job, platform=platform, locale=locale)
        else:
            upstream_artifacts = generate_upstream_artifacts(
                refs, platform, locale
            )
            # Clean up un-used artifact map, to avoid confusion
            if job['attributes'].get('artifact_map'):
                del job['attributes']['artifact_map']

        worker['upstream-artifacts'] = upstream_artifacts

        if locale:
            worker["locale"] = locale
        job["worker"] = worker

        yield job
def make_beetmover_checksums_worker(config, jobs):
    for job in jobs:
        valid_beetmover_job = (len(job["dependencies"]) == 1)
        if not valid_beetmover_job:
            raise NotImplementedError("Beetmover checksums must have one dependency.")

        locales = job["attributes"].get("chunk_locales")
        platform = job["attributes"]["build_platform"]

        refs = {
            "beetmover": None,
        }
        for dependency in job["dependencies"].keys():
            if dependency.startswith("release-beetmover"):
                refs['beetmover'] = "<{}>".format(dependency)
        if None in refs.values():
            raise NotImplementedError(
                "Beetmover checksums must have a beetmover dependency!")

        worker = {
            'implementation': 'beetmover',
            'release-properties': craft_release_properties(config, job),
            'upstream-artifacts': generate_beetmover_upstream_artifacts(
                config, job, platform, locales
            ),
            'artifact-map': generate_beetmover_artifact_map(
                config, job, platform=platform, locale=locales
            ),
        }

        job["worker"] = worker

        yield job
def make_task_worker(config, jobs):
    for job in jobs:
        platform = job["attributes"]["build_platform"]
        locale = job["attributes"]["chunk_locales"]

        job['worker'] = {
            'implementation':
            'beetmover',
            'release-properties':
            craft_release_properties(config, job),
            'upstream-artifacts':
            generate_beetmover_upstream_artifacts(
                config,
                job,
                platform,
                locale,
            ),
            'artifact-map':
            generate_beetmover_artifact_map(config,
                                            job,
                                            platform=platform,
                                            locale=locale),
        }

        yield job
def make_task_worker(config, jobs):
    for job in jobs:
        platform = job["attributes"]["build_platform"]
        locale = job["attributes"]["chunk_locales"]

        job["worker"] = {
            "implementation":
            "beetmover",
            "release-properties":
            craft_release_properties(config, job),
            "upstream-artifacts":
            generate_beetmover_upstream_artifacts(
                config,
                job,
                platform,
                locale,
            ),
            "artifact-map":
            generate_beetmover_artifact_map(config,
                                            job,
                                            platform=platform,
                                            locale=locale),
        }

        yield job
예제 #10
0
def get_geckoview_upstream_artifacts(config, job, platform=''):
    if not platform:
        platform = job['attributes']['build_platform']
    upstream_artifacts = generate_beetmover_upstream_artifacts(
        config, job, platform='',
        **get_geckoview_template_vars(config, platform, job['attributes'].get('update-channel'))
    )
    return [{
        key: value for key, value in upstream_artifact.items()
        if key != 'locale'
    } for upstream_artifact in upstream_artifacts]
예제 #11
0
def get_geckoview_upstream_artifacts(config, job, platform=""):
    if not platform:
        platform = job["attributes"]["build_platform"]
    upstream_artifacts = generate_beetmover_upstream_artifacts(
        config,
        job,
        platform="",
        **get_geckoview_template_vars(config, platform,
                                      job["attributes"].get("update-channel")))
    return [{
        key: value
        for key, value in upstream_artifact.items() if key != "locale"
    } for upstream_artifact in upstream_artifacts]
def make_beetmover_checksums_worker(config, jobs):
    for job in jobs:
        valid_beetmover_job = (len(job["dependencies"]) == 2)
        if not valid_beetmover_job:
            raise NotImplementedError(
                "Beetmover checksums must have two dependencies.")

        locale = job["attributes"].get("locale")
        platform = job["attributes"]["build_platform"]

        refs = {
            "beetmover": None,
            "signing": None,
        }
        for dependency in job["dependencies"].keys():
            if dependency.startswith("beetmover"):
                refs['beetmover'] = "<{}>".format(dependency)
            else:
                refs['signing'] = "<{}>".format(dependency)
        if None in refs.values():
            raise NotImplementedError(
                "Beetmover checksums must have a beetmover and signing dependency!"
            )

        if should_use_artifact_map(platform):
            upstream_artifacts = generate_beetmover_upstream_artifacts(
                config, job, platform, locale)
        else:
            upstream_artifacts = generate_upstream_artifacts(
                refs, platform, locale)

        worker = {
            'implementation': 'beetmover',
            'release-properties': craft_release_properties(config, job),
            'upstream-artifacts': upstream_artifacts,
        }

        if should_use_artifact_map(platform):
            worker['artifact-map'] = generate_beetmover_artifact_map(
                config, job, platform=platform)

        if locale:
            worker["locale"] = locale
        job["worker"] = worker

        yield job
예제 #13
0
def make_task_worker(config, jobs):
    for job in jobs:
        valid_beetmover_job = (len(job["dependencies"]) == 2 and any(
            ['signing' in j for j in job['dependencies']]))
        # XXX release snap-repackage has a variable number of dependencies, depending on how many
        # "post-beetmover-dummy" jobs there are in the graph.
        if '-snap-' not in job['label'] and not valid_beetmover_job:
            raise NotImplementedError("Beetmover must have two dependencies.")

        locale = job["attributes"].get("locale")
        platform = job["attributes"]["build_platform"]
        build_task = None
        signing_task = None
        for dependency in job["dependencies"].keys():
            if 'signing' in dependency:
                signing_task = dependency
            else:
                build_task = dependency

        signing_task_ref = "<" + str(signing_task) + ">"
        build_task_ref = "<" + str(build_task) + ">"

        if should_use_artifact_map(platform):
            upstream_artifacts = generate_beetmover_upstream_artifacts(
                config, job, platform, locale)
        else:
            upstream_artifacts = generate_upstream_artifacts(
                job, signing_task_ref, build_task_ref, platform, locale)
        worker = {
            'implementation': 'beetmover',
            'release-properties': craft_release_properties(config, job),
            'upstream-artifacts': upstream_artifacts,
        }

        if should_use_artifact_map(platform):
            worker['artifact-map'] = generate_beetmover_artifact_map(
                config, job, platform=platform, locale=locale)

        if locale:
            worker["locale"] = locale
        job["worker"] = worker

        yield job
def make_task_worker(config, jobs):
    for job in jobs:
        valid_beetmover_job = (len(job["dependencies"]) == 2 and any(
            ['signing' in j for j in job['dependencies']]))
        if not valid_beetmover_job:
            raise NotImplementedError("Beetmover must have two dependencies.")

        build_task = None
        signing_task = None
        for dependency in job["dependencies"].keys():
            if 'signing' in dependency:
                signing_task = dependency
            else:
                build_task = dependency

        signing_task_ref = "<{}>".format(str(signing_task))
        build_task_ref = "<{}>".format(str(build_task))

        worker = {
            'implementation': 'beetmover',
            'release-properties': craft_release_properties(config, job),
        }

        platform = job["attributes"]["build_platform"]
        # Works with Firefox/Devedition. Commented for migration.
        if should_use_artifact_map(platform):
            upstream_artifacts = generate_beetmover_upstream_artifacts(
                config, job, platform=None, locale=None)
        else:
            upstream_artifacts = generate_upstream_artifacts(
                job, signing_task_ref, build_task_ref)

        worker['upstream-artifacts'] = upstream_artifacts

        # Works with Firefox/Devedition. Commented for migration.
        if should_use_artifact_map(platform):
            worker['artifact-map'] = generate_beetmover_artifact_map(
                config, job, platform=platform)

        job["worker"] = worker

        yield job
예제 #15
0
def make_task_worker(config, jobs):
    for job in jobs:
        valid_beetmover_job = (len(job["dependencies"]) == 2 and any(
            ['signing' in j for j in job['dependencies']]))
        if not valid_beetmover_job:
            raise NotImplementedError("Beetmover must have two dependencies.")

        locale = job["attributes"].get("locale")
        platform = job["attributes"]["build_platform"]
        build_task = None
        signing_task = None
        for dependency in job["dependencies"].keys():
            if 'signing' in dependency:
                signing_task = dependency
            else:
                build_task = dependency

        signing_task_ref = "<" + str(signing_task) + ">"
        build_task_ref = "<" + str(build_task) + ">"

        if should_use_artifact_map(platform, config.params['project']):
            upstream_artifacts = generate_beetmover_upstream_artifacts(
                job, platform, locale)
        else:
            upstream_artifacts = generate_upstream_artifacts(
                job, signing_task_ref, build_task_ref, platform, locale)
        worker = {
            'implementation': 'beetmover',
            'release-properties': craft_release_properties(config, job),
            'upstream-artifacts': upstream_artifacts,
        }

        if should_use_artifact_map(platform, config.params['project']):
            worker['artifact-map'] = generate_beetmover_artifact_map(
                config, job, platform=platform, locale=locale)

        if locale:
            worker["locale"] = locale
        job["worker"] = worker

        yield job
예제 #16
0
def make_beetmover_checksums_worker(config, jobs):
    for job in jobs:
        locale = job["attributes"].get("locale")
        platform = job["attributes"]["build_platform"]

        worker = {
            "implementation": "beetmover",
            "release-properties": craft_release_properties(config, job),
            "upstream-artifacts": generate_beetmover_upstream_artifacts(
                config, job, platform, locale
            ),
            "artifact-map": generate_beetmover_artifact_map(
                config, job, platform=platform, locale=locale
            ),
        }

        if locale:
            worker["locale"] = locale
        job["worker"] = worker

        yield job