2024-10-01 13:25:57 发布
网友
我有一个fab脚本,它工作得很好。首先,我执行以下命令:
fab
fab -H 192.168.xx.xx deployFiles deployConfiguration:'master',7
deployFiles和{}都是my fabfile.py中的函数。'master'和7是deployConfiguration的参数
deployFiles
fabfile.py
'master'
7
deployConfiguration
我有另一个Python脚本,我想启动它内部之前的fab命令。在
如何使用Python脚本中的这些参数执行fabfile?在
你只需导入它们,然后调用它们。使用设置上下文管理器或将相关设置设置为fabric.api.env在
from fabric.context_managers import settings from fabfile import deployFiles, deployConfiguration with settings(host_string='user@192.168.xx.xx'): deployFiles() deployConfiguration('master', 7)
你只需导入它们,然后调用它们。使用设置上下文管理器或将相关设置设置为fabric.api.env在
相关问题 更多 >
编程相关推荐