fabfile.py 文件源码

python
阅读 21 收藏 0 点赞 0 评论 0

项目:flask-vue-semantic-docker 作者: italomaia 项目源码 文件源码
def do_setup():
    """
    Helps you setup your environment. Call it once per project.
    """
    msg = "Command not found. Please, install %s"
    assert get_cmd_exists('npm'), msg % "npm"
    assert get_cmd_exists('vue'), msg % "vue-cli"
    assert get_cmd_exists('fab'), msg % "fabric3"
    assert get_cmd_exists('docker'), msg % "docker"
    assert get_cmd_exists('docker-compose'), msg % "docker-compose"

    print("Setting up VueJS (just accept defaults)")
    local('vue init webpack ux', shell='/bin/bash')

    print("Setting up SemanticUI (just accept defaults)")
    with lcd(STYLES_DIR):
        local('npm install semantic-ui', shell='/bin/bash')

        semantic_settings = os.path.join(STYLES_DIR, 'semantic.json')
        with open(semantic_settings, 'r') as fs:
            data = json.load(fs)

        data['autoInstall'] = True
        with open(semantic_settings, 'w') as fs:
            json.dump(data, fs)

    print(
        "IMPORTANT: run the following command:\n"
        "sudo echo \"127.0.0.1  dv\" >> /etc/hosts")

    print(
        "IMPORTANT: make sure to update your envfile file with "
        "your project production configuration.")
    print(
        "IMPORTANT: make sure to update your fabfile "
        "hosts with your production host.")
    print("")
    print("Now you're ready to go:")
    print('  fab env:dev up  # for development mode')
    print('  fab env:prd up  # for production mode')
    print('  fab env:tst up  # to simulate production mode')
    print('Locally, your project will be available at http://dv:8080')
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号