python类prefix()的实例源码

fabfile.py 文件源码 项目:startupintro 作者: ShubhamBansal1997 项目源码 文件源码 阅读 21 收藏 0 点赞 0 评论 0
def virtualenv():
    """Activates virtualenv context for other commands to run inside it.
    """
    with fab.cd(HERE):
        with fab.prefix('source %(virtualenv_dir)s/bin/activate' % env):
            yield
fabfile.py 文件源码 项目:FormShare 作者: qlands 项目源码 文件源码 阅读 18 收藏 0 点赞 0 评论 0
def source(path):
    return prefix('source %s' % path)
fabfile.py 文件源码 项目:FormShare 作者: qlands 项目源码 文件源码 阅读 26 收藏 0 点赞 0 评论 0
def deploy_template(env):
    if env.get('template'):
        run("git remote add template %s || true" % env.template)
        run("git fetch template")
        run("git reset HEAD %s && rm -rf %s" % (env.template_dir,
                                                env.template_dir))
        run("git read-tree --prefix=%s -u template/master"
            % env.template_dir)
fabfile.py 文件源码 项目:perdiem-django 作者: RevolutionTech 项目源码 文件源码 阅读 18 收藏 0 点赞 0 评论 0
def deploy():
    with prefix(". /usr/local/bin/virtualenvwrapper.sh; workon perdiem"):
        previous_commit_hash = run("git log -1 --format=\"%H\" --no-color", pty=False)
        run("git pull")
        cmd_changes_deployed = "git log {previous_hash}.. --reverse --format=\"%h : %an : %s\" --no-color".format(
            previous_hash=previous_commit_hash
        )
        changes_deployed = run(cmd_changes_deployed, pty=False)
        run("pip install -r ../requirements.txt")
        run("python manage.py migrate")
        run("python manage.py collectstatic --no-input")
        sudo("sv restart perdiem")
    send_notification(changes_deployed)
fabfile.py 文件源码 项目:cookiecutter-flask-seed-minimal 作者: hypebeast 项目源码 文件源码 阅读 22 收藏 0 点赞 0 评论 0
def install_dist_package():
    """Install the dist package on the remote host(s)."""
    with cd(remote_app_dir):
        with prefix(env.activate):
            sudo('pip install {}'.format(dist_package_file))

    # remove dist package
    run('rm {}'.format(dist_package_file))

# END DEPLOYMENT HELPERS


# Supervisor


问题


面经


文章

微信
公众号

扫码关注公众号