First Fabric (Python deployment tool)

I tried using Fabric, a Python deploy tool, so I will show you how to use it.


[Desktop] sudo easy_install fabric
Finished processing dependencies for fabric
[Desktop] fab -V                                                                                                     16:37:15
Fabric 1.10.2
Paramiko 1.16.0

Try local ()

Create in any directory

from fabric.api import local
def test():

The above statement means that if you run $ fab test in the directory where the created fabfile is located, it will run $ top in that directory. With this you can use it for multiple servers

run("cd /var/www/apps/your_app; git checkout master; git pull origin master")

You can do something like that.

About the run () command

The content itself is the same as local (), just that run is executed on a remote server.

SFTP transfer (put)

** About put **

--First argument: Local server (source) --Second argument: Remote server (destination) --Third argument and after: Specify access authority, execute authority, etc.



Notification to slack

fabric-slack-tool is the most decent library so far.

How to write a specific

If you search with Gist, you will find many Search · · GitHub


-Overview and Tutorial (Official Site) --Run commands on remote server using Fabric -[Fabric writing tips]( % 9F% E3% 81% 84) -Tips to help you use the Python deployment tool Fabric for the first time

Recommended Posts

First Fabric (Python deployment tool)
First time python
First Python 3 ~ First comparison ~
Idempotent guarantee with deployment tool fabric + cuisine
First time python
First Python ~ Coding 2 ~
First python [O'REILLY]
Why we chose Fabric as our deployment tool
First Python 3rd Edition
PyQ ~ Python First Steps ~
First Python image processing
[Python] Python / Scikit-learn's first SVM
First Python miscellaneous notes
[Python] Chapter 01-01 About Python (First Python)
[Python tutorial] Control structure tool
First neuron simulation with NEURON + Python
Install Cheminformatics Tool RDKit for Python
First simple regression analysis in Python
First Python 3 ~ The beginning of repetition ~
Use fabric as is in python (fabric3)
Web scraping with Python First step
First Python 3 ~ Extra: Numerical Random Fantasy ~
[GUI with Python] PyQt5-The first step-
Prepare your first Python development environment
Python package management tool personal summary
Python (from first time to execution)
C / C ++ programmer challenges Python (first step)
Created AtCoder test tool for Python
See python for the first time
[Python] Creating a scraping tool Memo
The first step in Python Matplotlib
Easy deployment environment with gaffer + fabric