deployment - python fabric run function once for all servers -
We have a deployment script that has 5 servers, we run the script and notify us once, though it is 5 Server.
example code:
env.hosts = ['web1', 'web2', 'web3', 'web4', 'web5']
< Code> def notify (): sendNotify () @task def deployment (): sendNotify () deploying deployment items deploying things deploying
I think that Be informed will be asked only once, but because there are 5 servers, it is called 5 times.
Maybe you < notify
at code> @Runs_once Decorator.
See:
Comments
Post a Comment