示例#1
0
async def do_actions(context, actions, directory):
    """Perform the set of actions that treescript can perform.

    The actions happen in order, tagging, ver bump, then push
    """
    for action in actions:
        if 'tagging' == action:
            await do_tagging(context, directory)
        elif 'version_bump' == action:
            await bump_version(context)
        elif 'push' == action:
            pass  # handled after log_outgoing
        else:
            raise NotImplementedError("Unexpected action")
    await log_outgoing(context, directory)
    if is_dry_run(context.task):
        log.info("Not pushing changes, dry_run was forced")
    elif 'push' in actions:
        await push(context)
    else:
        log.info("Not pushing changes, lacking scopes")
示例#2
0
async def do_actions(context, actions, directory):
    """Perform the set of actions that treescript can perform.

    The actions happen in order, tagging, ver bump, then push
    """
    short_actions = [a.rsplit(':', 1)[1] for a in actions]
    short_actions.sort()  # Order we want to run in, just happens to be alphabetical sort.
    for action in short_actions:
        if 'tagging' == action:
            await do_tagging(context, directory)
        elif 'version_bump' == action:
            await bump_version(context)
        elif 'push' == action:
            pass  # handled after log_outgoing
        else:
            raise NotImplementedError("Unexpected action")
    await log_outgoing(context, directory)
    if is_dry_run(context.task):
        log.info("Not pushing changes, dry_run was forced")
    elif 'push' in short_actions:
        await push(context)
    else:
        log.info("Not pushing changes, lacking scopes")
示例#3
0
def test_is_dry_run_true():
    task = {'payload': {'dry_run': True}}
    assert True is utils.is_dry_run(task)
示例#4
0
def test_is_dry_run(task):
    assert False is utils.is_dry_run(task)
示例#5
0
def test_is_dry_run_true():
    task = {'payload': {'dry_run': True}}
    assert True is utils.is_dry_run(task)
示例#6
0
def test_is_dry_run(task):
    assert False is utils.is_dry_run(task)