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
[Desktop]
pip install fabric
Create fabfile.py
in any directory
from fabric.api import local
def test():
local("top")
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.
The content itself is the same as local ()
, just that run is executed on a remote server.
** About put **
--First argument: Local server (source) --Second argument: Remote server (destination) --Third argument and after: Specify access authority, execute authority, etc.
Example
put(
"your_app_dir",
"/var/www/apps/",
mode=0755,
use_sudo=True
)
fabric-slack-tool is the most decent library so far.
If you search with Gist, you will find many Search · fabfile.py · GitHub
-Overview and Tutorial (Official Site) --Run commands on remote server using Fabric -[Fabric writing tips](http://qiita.com/narikei/items/99e77eb2ff4029f2157c#local%E3%81%A7%E5%AE%9F%E8%A1%8C%E3%81%97%E3%81 % 9F% E3% 81% 84) -Tips to help you use the Python deployment tool Fabric for the first time
Recommended Posts