Welcome to Fabric!

Fabric 中文文档(对应v1.10版本)http://fabric-docs-zh.rtfd.org/

当前状态:翻译中

章节 认领人 状态
index.rst halfcrazy 翻译完,待校对
tutorial.rst halfcrazy 翻译完,待校对
env.rst halfcrazy 翻译中
execution.rst halfcrazy 翻译中
fab.rst orangle 翻译中
fabfiles.rst orangle 翻译中
interactivity.rst 待认领  
library.rst 待认领  
output_controls.rst 待认领  
pararllel.rst 待认领  
ssh.rst 待认领  
tasks.rst 待认领  

Fabric 是一个 Python(2.5-2.7)库以及命令行工具用于流式使用 SSH 来部署应用程序或者系统管理任务。

它提供了一个基础的套件用于执行本地或者远程 shell 命令(正常执行或者通过 sudo 执行),上传/下载文件,也有类似于提示运行中用户输入的辅助功能或中止执行。

通常用于调用创造的一个包含一个或多个功能的 Python 模块,然后通过 fab 命令行工具执行它们。下面是一个小而完整的包含一个任务的 “fabfile” 文件:

from fabric.api import run

def host_type():
    run('uname -s')

当一个任务被定义后,它可以运行在一台或多台服务器上,就像这样:

$ fab -H localhost,linuxbox host_type
[localhost] run: uname -s
[localhost] out: Darwin
[linuxbox] run: uname -s
[linuxbox] out: Linux

Done.
Disconnecting from localhost... done.
Disconnecting from linuxbox... done.

除了通过 fab 工具使用,Fabric 的组件也可以被导入到其他 Python 代码中,提供一个相对于 Paramiko 库(Fabric 自身使用的)更高层级上的 SSH 协议的 Pythonic 的接口。


This website covers project information for Fabric such as the changelog, contribution guidelines, development roadmap, news/blog, and so forth. Detailed usage and API documentation can be found at our code documentation site, docs.fabfile.org.

Please see the navigation sidebar to the left to begin.

Fabric

Pythonic remote execution

https://secure.travis-ci.org/fabric/fabric.png?branch=master

Navigation


Donate

Consider supporting the authors on Gratipay: