Exemplo n.º 1
0
def run_hook(repo_cmd_runner, hook, file_args):  # pragma: windows no cover
    assert_docker_available()
    # Rebuild the docker image in case it has gone missing, as many people do
    # automated cleanup of docker images.
    build_docker_image(repo_cmd_runner, pull=False)

    hook_cmd = helpers.to_cmd(hook)
    entry_executable, cmd_rest = hook_cmd[0], hook_cmd[1:]

    cmd = (
        'docker',
        'run',
        '--rm',
        '-u',
        '{}:{}'.format(os.getuid(), os.getgid()),
        '-v',
        '{}:/src:rw'.format(os.getcwd()),
        '--workdir',
        '/src',
        '--entrypoint',
        entry_executable,
        docker_tag(repo_cmd_runner),
    ) + cmd_rest

    return xargs(cmd, file_args)
Exemplo n.º 2
0
def run_hook(hook, file_args):  # pragma: windows no cover
    assert_docker_available()
    # Rebuild the docker image in case it has gone missing, as many people do
    # automated cleanup of docker images.
    build_docker_image(hook.prefix, pull=False)

    hook_cmd = helpers.to_cmd(hook)
    entry_exe, cmd_rest = hook_cmd[0], hook_cmd[1:]

    entry_tag = ('--entrypoint', entry_exe, docker_tag(hook.prefix))
    cmd = docker_cmd() + entry_tag + cmd_rest
    return helpers.run_xargs(hook, cmd, file_args)
Exemplo n.º 3
0
def run_hook(hook, file_args):  # pragma: windows no cover
    assert_docker_available()
    # Rebuild the docker image in case it has gone missing, as many people do
    # automated cleanup of docker images.
    build_docker_image(hook.prefix, pull=False)

    hook_cmd = helpers.to_cmd(hook)
    entry_exe, cmd_rest = hook_cmd[0], hook_cmd[1:]

    entry_tag = ('--entrypoint', entry_exe, docker_tag(hook.prefix))
    cmd = docker_cmd() + entry_tag + cmd_rest
    return helpers.run_xargs(hook, cmd, file_args)
Exemplo n.º 4
0
def run_hook(repo_cmd_runner, hook, file_args):  # pragma: windows no cover
    assert_docker_available()
    # Rebuild the docker image in case it has gone missing, as many people do
    # automated cleanup of docker images.
    build_docker_image(repo_cmd_runner, pull=False)

    hook_cmd = helpers.to_cmd(hook)
    entry_executable, cmd_rest = hook_cmd[0], hook_cmd[1:]

    cmd = (
        'docker', 'run',
        '--rm',
        '-u', '{}:{}'.format(os.getuid(), os.getgid()),
        '-v', '{}:/src:rw'.format(os.getcwd()),
        '--workdir', '/src',
        '--entrypoint', entry_executable,
        docker_tag(repo_cmd_runner)
    ) + cmd_rest

    return xargs(cmd, file_args)
Exemplo n.º 5
0
def run_hook(repo_cmd_runner, hook, file_args):
    cmd = helpers.to_cmd(hook)
    cmd = (repo_cmd_runner.prefix_dir + cmd[0],) + cmd[1:]
    return xargs(cmd, file_args)
Exemplo n.º 6
0
def run_hook(repo_cmd_runner, hook, file_args):
    with in_env(repo_cmd_runner, hook['language_version']):
        return xargs(helpers.to_cmd(hook), file_args)
Exemplo n.º 7
0
def run_hook(repo_cmd_runner, hook, file_args):  # pragma: windows no cover
    with in_env(repo_cmd_runner):
        return xargs(helpers.to_cmd(hook), file_args)
Exemplo n.º 8
0
def run_hook(prefix, hook, file_args):  # pragma: windows no cover
    with in_env(prefix, hook['language_version']):
        return xargs(helpers.to_cmd(hook), file_args)
Exemplo n.º 9
0
def run_hook(repo_cmd_runner, hook, file_args):  # pragma: windows no cover
    assert_docker_available()
    cmd = docker_cmd() + helpers.to_cmd(hook)
    return xargs(cmd, file_args)
Exemplo n.º 10
0
 def run_hook(hook, file_args):
     with in_env(hook.prefix, hook.language_version):
         return helpers.run_xargs(hook, helpers.to_cmd(hook), file_args)
Exemplo n.º 11
0
def run_hook(repo_cmd_runner, hook, file_args):
    cmd = helpers.to_cmd(hook)
    cmd = (repo_cmd_runner.prefix_dir + cmd[0], ) + cmd[1:]
    return xargs(cmd, file_args)
Exemplo n.º 12
0
def run_hook(hook, file_args):  # pragma: windows no cover
    with in_env(hook.prefix):
        return helpers.run_xargs(hook, helpers.to_cmd(hook), file_args)
Exemplo n.º 13
0
def run_hook(hook, file_args):  # pragma: windows no cover
    assert_docker_available()
    cmd = docker_cmd() + helpers.to_cmd(hook)
    return helpers.run_xargs(hook, cmd, file_args)
Exemplo n.º 14
0
def run_hook(hook, file_args):  # pragma: windows no cover
    assert_docker_available()
    cmd = docker_cmd() + helpers.to_cmd(hook)
    return helpers.run_xargs(hook, cmd, file_args)
Exemplo n.º 15
0
def run_hook(hook, file_args):
    cmd = helpers.to_cmd(hook)
    cmd = (hook.prefix.path(cmd[0]), ) + cmd[1:]
    return helpers.run_xargs(hook, cmd, file_args)
Exemplo n.º 16
0
def run_hook(hook, file_args):
    with in_env(hook.prefix):
        return helpers.run_xargs(hook, helpers.to_cmd(hook), file_args)
Exemplo n.º 17
0
def run_hook(hook, file_args):
    return helpers.run_xargs(hook, helpers.to_cmd(hook), file_args)
Exemplo n.º 18
0
def run_hook(hook, file_args):
    cmd = helpers.to_cmd(hook)
    cmd = (hook.prefix.path(cmd[0]),) + cmd[1:]
    return helpers.run_xargs(hook, cmd, file_args)
Exemplo n.º 19
0
def run_hook(repo_cmd_runner, hook, file_args):  # pragma: windows no cover
    with in_env(repo_cmd_runner, hook['language_version']):
        return xargs(helpers.to_cmd(hook), file_args)
Exemplo n.º 20
0
def run_hook(repo_cmd_runner, hook, file_args):
    with in_env(repo_cmd_runner):
        return xargs(helpers.to_cmd(hook), file_args)
Exemplo n.º 21
0
def run_hook(prefix, hook, file_args):
    return helpers.run_xargs(hook, helpers.to_cmd(hook), file_args)
Exemplo n.º 22
0
def run_hook(prefix, hook, file_args):
    with in_env(prefix):
        return xargs(helpers.to_cmd(hook), file_args)
Exemplo n.º 23
0
def run_hook(hook, file_args):
    with in_env(hook.prefix):
        return helpers.run_xargs(hook, helpers.to_cmd(hook), file_args)
Exemplo n.º 24
0
def run_hook(repo_cmd_runner, hook, file_args):
    with in_env(repo_cmd_runner):
        return xargs(helpers.to_cmd(hook), file_args)
Exemplo n.º 25
0
def run_hook(prefix, hook, file_args):
    cmd = helpers.to_cmd(hook)
    cmd = (prefix.path(cmd[0]), ) + cmd[1:]
    return xargs(cmd, file_args)
Exemplo n.º 26
0
def run_hook(prefix, hook, file_args):
    with in_env(prefix, hook['language_version']):
        return helpers.run_xargs(hook, helpers.to_cmd(hook), file_args)
Exemplo n.º 27
0
def run_hook(repo_cmd_runner, hook, file_args):  # pragma: windows no cover
    assert_docker_available()
    cmd = docker_cmd() + helpers.to_cmd(hook)
    return xargs(cmd, file_args)