Beispiel #1
0
async def async_main(context):
    context.task = client.get_task(context.config)
    _log_warning_forewords(context)

    # TODO Sanity checks on the file
    snap_file_path = artifacts.get_snap_file_path(context)
    channel = task.pluck_channel(context.task)
    snap_store.push(context, snap_file_path, channel)
Beispiel #2
0
async def async_main(context):
    context.task = client.get_task(context.config)

    channel = task.get_flatpak_channel(context.config, context.task)
    flatpak_file_path = artifacts.get_flatpak_file_path(context)

    _log_warning_forewords(context.config, channel)

    flathub.push(context, flatpak_file_path, channel)
Beispiel #3
0
async def async_main(context):
    context.task = get_task(context.config)

    # determine the task server and action
    context.server = get_task_server(context.task, context.config)
    context.action = get_task_action(context.task, context.config)

    # perform schema validation for the corresponding type of task
    validate_task_schema(context, action_map[context.action]['schema'])

    # perform the appropriate behavior
    await action_map[context.action]['function'](context)
Beispiel #4
0
async def async_main(context):
    # balrog_manifest is written and uploaded as an artifact which is used by a subsequent
    # balrogworker task in the release graph. Balrogworker uses this manifest to submit
    # release blob info with things like mar filename, size, etc
    context.balrog_manifest = list()

    # the checksums manifest is written and uploaded as an artifact which is used
    # by a subsequent signing task and again by another beetmover task to
    # upload it along with the other artifacts
    context.checksums = dict()

    # determine and validate the task schema along with its scopes
    context.task = get_task(context.config)  # e.g. $cfg['work_dir']/task.json
    validate_task_schema(context)

    # determine artifacts to beetmove
    context.artifacts_to_beetmove = get_upstream_artifacts(context)
    # determine the release properties and make a copy in the artifacts
    # directory
    release_props_file = get_initial_release_props_file(context)
    context.release_props = get_release_props(release_props_file)

    # generate beetmover mapping manifest
    mapping_manifest = generate_beetmover_manifest(context.config,
                                                   context.task,
                                                   context.release_props)
    # validate scopes to prevent beetmoving in the wrong place
    validate_task_scopes(context, mapping_manifest)

    # some files to-be-determined via script configs need to have their
    # contents pretty named, so doing it here before even beetmoving begins
    blobs = context.config.get('blobs_needing_prettynaming_contents', [])
    alter_unpretty_contents(context, blobs, mapping_manifest)

    # for each artifact in manifest
    #   a. map each upstream artifact to pretty name release bucket format
    #   b. upload to candidates/dated location
    await move_beets(context, context.artifacts_to_beetmove, mapping_manifest)

    #  write balrog_manifest to a file and add it to list of artifacts
    add_balrog_manifest_to_artifacts(context)
    # determine the correct checksum filename and generate it, adding it to
    # the list of artifacts afterwards
    add_checksums_to_artifacts(context)
    # add release props file to later be used by beetmover jobs than upload
    # the checksums file
    add_release_props_to_artifacts(context, release_props_file)

    log.info('Success!')
Beispiel #5
0
async def async_main(context):
    # determine the task and make a quick validation check against its schema
    context.task = get_task(context.config)  # e.g. $cfg['work_dir']/task.json
    validate_task_schema(context)

    # determine the task bucket and action
    context.bucket = get_task_bucket(context.task, context.config)
    context.action = get_task_action(context.task, context.config)

    if action_map.get(context.action):
        await action_map[context.action](context)
    else:
        log.critical("Unknown action {}!".format(context.action))
        sys.exit(3)

    log.info('Success!')
Beispiel #6
0
async def async_main(context):
    # balrog_manifest is used by a subsequent balrogworker task that points to a beetmoved artifact
    context.balrog_manifest = list()

    # 1. parse the task
    context.task = get_task(context.config)  # e.g. $cfg['work_dir']/task.json
    # 2. validate the task
    validate_task_schema(context)
    # 3 prepare manifest props file
    #   a. grab manifest props with all the useful data
    #   b. amend platform field to proper one
    context.properties = await get_props(context)
    context.properties = update_props(context.properties, PLATFORM_MAP)
    # 4. generate manifest
    manifest = generate_candidates_manifest(context)
    # 5. for each artifact in manifest
    #   a. download artifact
    #   b. upload to candidates/dated location
    await move_beets(context, manifest)
    # 6. write balrog_manifest to a file and add it to list of artifacts
    if context.task["payload"]["update_manifest"]:
        add_balrog_manifest_to_artifacts(context)
    log.info('Success!')
Beispiel #7
0
def test_get_task(config):
    copyfile(BASIC_TASK, os.path.join(config["work_dir"], "task.json"))
    assert client.get_task(config)["this_is_a_task"] is True
Beispiel #8
0
def test_get_missing_task(config):
    with pytest.raises(ScriptWorkerTaskException):
        client.get_task(config)
Beispiel #9
0
 def test_get_task(self, config):
     copyfile(BASIC_TASK, os.path.join(config['work_dir'], "task.json"))
     assert client.get_task(config)["this_is_a_task"] is True
Beispiel #10
0
 def test_get_missing_task(self, config):
     with pytest.raises(ScriptWorkerTaskException):
         client.get_task(config)