DESCRIPTION.rst 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. To find out what's new in this version of Fabric, please see `the changelog
  2. <http://fabfile.org/changelog.html>`_.
  3. You can also install the `development version via ``pip install -e
  4. git+https://github.com/fabric/fabric/#egg=fabric``.
  5. ----
  6. Fabric is a Python (2.5-2.7) library and command-line tool for
  7. streamlining the use of SSH for application deployment or systems
  8. administration tasks.
  9. It provides a basic suite of operations for executing local or remote shell
  10. commands (normally or via ``sudo``) and uploading/downloading files, as well as
  11. auxiliary functionality such as prompting the running user for input, or
  12. aborting execution.
  13. Typical use involves creating a Python module containing one or more functions,
  14. then executing them via the ``fab`` command-line tool. Below is a small but
  15. complete "fabfile" containing a single task:
  16. .. code-block:: python
  17. from fabric.api import run
  18. def host_type():
  19. run('uname -s')
  20. If you save the above as ``fabfile.py`` (the default module that
  21. ``fab`` loads), you can run the tasks defined in it on one or more
  22. servers, like so::
  23. $ fab -H localhost,linuxbox host_type
  24. [localhost] run: uname -s
  25. [localhost] out: Darwin
  26. [linuxbox] run: uname -s
  27. [linuxbox] out: Linux
  28. Done.
  29. Disconnecting from localhost... done.
  30. Disconnecting from linuxbox... done.
  31. In addition to use via the ``fab`` tool, Fabric's components may be imported
  32. into other Python code, providing a Pythonic interface to the SSH protocol
  33. suite at a higher level than that provided by e.g. the ``Paramiko`` library
  34. (which Fabric itself uses.)
  35. ----
  36. For more information, please see the Fabric website or execute ``fab --help``.