How to set target hosts in Fabric file

后端 未结 15 720
南方客
南方客 2020-11-29 15:27

I want to use Fabric to deploy my web app code to development, staging and production servers. My fabfile:

def deploy_2_dev():
  deploy(\'dev\')

def deploy_         


        
15条回答
  •  轻奢々
    轻奢々 (楼主)
    2020-11-29 15:55

    You can assign to env.hoststring before executing a subtask. Assign to this global variable in a loop if you want to iterate over multiple hosts.

    Unfortunately for you and me, fabric is not designed for this use case. Check out the main function at http://github.com/bitprophet/fabric/blob/master/fabric/main.py to see how it works.

提交回复
热议问题