Python: overview of Fabric

来源:互联网 发布:启动盘制作工具mac版 编辑:程序博客网 时间:2024/05/19 10:34

What is Fabric?

Fabric is a Python (2.5 or higher) library and command-line tool for streamlining the use of SSH for application deployment or systems administration tasks.

More specifically, Fabric is:

A tool that lets you execute arbitrary Python functions via the command line;

A library of subroutines (built on top of a lower-level library) to make executing shell commands over SSH easy and Pythonic.

Naturally, most users combine these two things, using Fabric to write and execute Python functions, or tasks, to automate interactions with remote servers

How to use Fabric?

In its most simple form, fab may be called with no options at all, and with one or more arguments, which should be task names.

$ fab task1 task2;$ fab task:arguments