I have a django app and I wrote a fabric script that installs my app on deployment server (Cent OS 5).
Now I want to run the same fabric script locally on the deployment server.
Is there a way to do it without supplying ssh user and password?
I mean just with “-H localhost”?
Thanks, Alex A.
Yes, you can run fab locally by using method local instead of run. What I do typically is have methods for setting up the environment, and call these methods first before calling the actual task. Let me illustrate this with an example for your specific question
fabfile.py
And based on the environment, you can do the following
Install on localhost:
Install on remote machine: