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_
So, in order to set the hosts, and have the commands run across all the hosts, you have to start with:
def PROD():
env.hosts = ['10.0.0.1', '10.0.0.2']
def deploy(version='0.0'):
sudo('deploy %s' % version)
Once those are defined, then run the command on the command line:
fab PROD deploy:1.5
What will run the deploy task across all of the servers listed in the PROD function, as it sets the env.hosts before running the task.