Skip to content

pavanmishra/fabric

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Fabric is a Python library and command-line tool designed to streamline
deploying applications or performing system administration tasks via the SSH
protocol. It provides tools for running arbitrary shell commands (either as a
normal login user, or via ``sudo``), uploading and downloading files, and so
forth.

Typical use involves defining a "fabfile" (a Python module) containing one or
more functions or tasks which may then be executed by the ``fab`` command-line
tool. For example, here's a small (but complete) ``fabfile.py`` containing a
single task::

    from fabric.api import run

    def host_type():
        """
        Prints host type (via ``uname -s``) for a remote host.
        """
        run('uname -s')

Executing this on an arbitrary server or list of servers is simple (below,
we're using an ssh-agent, and so there are no password prompts)::

    $ 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.

Fabric provides extra functionality related to this mode of use, such as
prompting for user input, ensuring certain variables are present in order for
tasks to run, and specifying which host or hosts a specific task connects to
by default.

Fabric may also be used as a standalone library, so that other Python programs
needing a simple but powerful API on top of SSH or SCP may import and utilize
specific pieces of functionality.

About

Simple, Pythonic remote execution and deployment

Resources

License

Stars

Watchers

Forks

Packages

No packages published