Ejemplo n.º 1
0
def after_deploy():
    paths.symlink(
        paths.get_shared_path(".htaccess"),
        paths.get_current_path(".htaccess")
    )

    paths.symlink(
        paths.get_upload_path(),
        paths.get_current_path("wp-content/uploads")
    )
Ejemplo n.º 2
0
def after_deploy():
    paths.symlink(
        paths.get_shared_path(".htaccess"),
        paths.get_current_path(".htaccess")
    )

    paths.symlink(
        paths.get_upload_path(),
        paths.get_current_path("app/uploads")
    )
Ejemplo n.º 3
0
def deploy():
    envfile.symlink_env()

    with prefix("source %s" % (virtualenv.get_path() + "/bin/activate")):
        virtualenv.update_requirements()
        _migrate()

    if "public_path" in env:
        paths.symlink(paths.get_current_path(), env.public_path)
Ejemplo n.º 4
0
def deploy():
    envfile.symlink_env()

    with prefix("source %s" % (virtualenv.get_path()+"/bin/activate")):
        virtualenv.update_requirements()
        _migrate()

    if "public_path" in env:
        paths.symlink(paths.get_current_path(), env.public_path)
Ejemplo n.º 5
0
def deploy():
    composer.install()
    composer.update()

    paths.symlink(
        paths.get_shared_path(".htaccess"),
        paths.get_current_path(".htaccess")
    )

    paths.symlink(
        paths.get_shared_path("wp-config.php"),
        paths.get_current_path("wp-config.php")
    )

    paths.symlink(
        paths.get_upload_path(),
        paths.get_current_path("wp-content/uploads")
    )
Ejemplo n.º 6
0
def after_deploy():
    paths.symlink(
        paths.get_upload_path(),
        paths.get_current_path("app/uploads")
    )

    paths.symlink(
        paths.get_shared_path("robots.txt"),
        paths.get_current_path("robots.txt")
    )

    env.run('rm -rf /var/run/nginx-cache/*')
    env.run('service nginx restart')
    env.run('service php7.0-fpm restart')

    env.run(
        "cd %s && "
        "wp --allow-root cache flush && "
        "wp --allow-root rewrite flush" % paths.get_current_path()
    )
Ejemplo n.º 7
0
def sync_remote_to_local(force="no"):
    """
    Replace your remote db with your local

    Example:
        sync_remote_to_local:force=yes
    """

    assert "local_wp_dir" in env, "Missing local_wp_dir in env"

    if force != "yes":
        message = "This will replace your local database with your "\
            "remote, are you sure [y/n]"
        answer = prompt(message, "y")

        if answer != "y":
            logger.info("Sync stopped")
            return

    init_tasks()  # Bootstrap fabrik

    remote_file = "sync_%s.sql" % int(time.time() * 1000)
    remote_path = "/tmp/%s" % remote_file

    with env.cd(paths.get_current_path()):
        env.run("wp db export %s" % remote_path)

    local_wp_dir = env.local_wp_dir
    local_path = "/tmp/%s" % remote_file

    # Download sync file
    get(remote_path, local_path)

    with lcd(local_wp_dir):
        elocal("wp db import %s" % local_path)

    # Cleanup
    env.run("rm %s" % remote_path)
    elocal("rm %s" % local_path)
Ejemplo n.º 8
0
def sync_remote_to_local(force="no"):
    """
    Replace your remote db with your local

    Example:
        sync_remote_to_local:force=yes
    """

    assert "local_wp_dir" in env, "Missing local_wp_dir in env"

    if force != "yes":
        message = "This will replace your local database with your "\
            "remote, are you sure [y/n]"
        answer = prompt(message, "y")

        if answer != "y":
            logger.info("Sync stopped")
            return

    init_tasks()  # Bootstrap fabrik

    remote_file = "sync_%s.sql" % int(time.time()*1000)
    remote_path = "/tmp/%s" % remote_file

    with env.cd(paths.get_current_path()):
        env.run("wp db export %s" % remote_path)

    local_wp_dir = env.local_wp_dir
    local_path = "/tmp/%s" % remote_file

    # Download sync file
    get(remote_path, local_path)

    with lcd(local_wp_dir):
        elocal("wp db import %s" % local_path)

    # Cleanup
    env.run("rm %s" % remote_path)
    elocal("rm %s" % local_path)
Ejemplo n.º 9
0
def after_deploy():
    with (env.cd(paths.get_current_path())):
        forever.restart()