Ejemplo n.º 1
0
def deploy(owner, upload_hook=None, revision='HEAD', keep_versions=10):
    if not user.exists(owner):
        log.abort('Specified owner does not exists! Deploy aborted')

    # Ensure some directories
    paths = _ensure_layout(owner)
    new_release_dir = _create_new_release_dir(owner, paths['releases'])
    paths['new_release'] = new_release_dir

    # Upload the new version and call the after upload hook
    _upload(owner, new_release_dir, revision)
    if upload_hook:
        with ctx.sudo(owner), ctx.cd(new_release_dir):
            upload_hook(owner, paths)

    # Activate the new release and 
    _symlink_release(owner, paths['current'], new_release_dir)
    _clear_old_releases(paths['releases'], keep_versions)

    return paths
Ejemplo n.º 2
0
def inside():
    return dir.exists("/vagrant") and user.exists("vagrant")
Ejemplo n.º 3
0
def inside():
    return dir.exists('/vagrant') and user.exists('vagrant')
Ejemplo n.º 4
0
def test_exists(get):
    get.expects_call().with_args("user").returns(None)
    assert not user.exists("user")

    get.expects_call().with_args("user").returns({})
    assert user.exists("user")
Ejemplo n.º 5
0
def inside():
    return dir.exists("/vagrant") and user.exists("vagrant")