python - Fabric 中的 YAML 文件

标签 python fabric

关于使用 Fabric,在“Tav 的博客”中:http://tav.espians.com/fabric-python-with-cleaner-api-and-parallel-deployment-support.html

我了解到 Fabric 可以支持 YAML 配置文件。

env.config_file = 'deploy.yaml'

然后您可以使用“env.config”变量访问 YAML 数据,如下所示:

def get_latest_commit():
    return urlopen(env.config.commits_server).read()


@task
    def deploy():
        with cd(env.config.app_directory):
        ...

出于某种原因,我无法使它正常工作。

有人用过吗?他们能否给我一个简单的解释或示例,说明如何在 Fabric 文件中使用这些 YAML 配置?

最佳答案

Tav 的博客是 Fabric 的自定义分支,未被纳入主线。它目前也已过时。

您设置这些的方式是使用 fabricrc 文件。这是在这里讨论的:

http://docs.fabfile.org/en/1.7/usage/fab.html?highlight=fabricrc#settings-files

这里

http://docs.fabfile.org/en/1.7/usage/fabfiles.html?highlight=fabricrc

关于python - Fabric 中的 YAML 文件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17654144/

相关文章:

python - 如何将带有复合 header 的 .csv 读入 xarray DataArray(使用 pandas)

python - Scraper 无法打印所有结果

Python:如何使用散点图在 map 上绘制数组?

Python - 将 Fabric 与 Sudo 结合使用

python - 使用 Vagrant 和 Docker 运行 Python SSH 单元测试

amazon-ec2 - 告知何时可以连接到新的 ec2 主机的过程

python - 缺少 datetime.timedelta.to_seconds() -> 在 Python 中 float ?

python - 使用选项从 Matlab 2017 调用 Python

python - 如何捕获 Fabric 中的身份验证错误并重试?

python - Fabric 密码