I have a fab
script, it works fine. To start it, I execute:
fab -H 192.168.xx.xx deployFiles deployConfiguration:'master',7
deployFiles
and deployConfiguration
are both functions in my fabfile.py
. 'master'
and 7
are my parameters for deployConfiguration
I have another Python script and I want to launch, the previous fab
command inside him.
How can I execute, my fabfile with these parameters from a Python script?
You just import them, and call them. Using either the settings context manager or setting the relevant settings on fabric.api.env
from fabric.context_managers import settings
from fabfile import deployFiles, deployConfiguration
with settings(host_string='[email protected]'):
deployFiles()
deployConfiguration('master', 7)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With