关于使用 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/