我正在尝试设置fabfile来部署我的Django应用程序.
我无法弄清楚为什么我收到此错误:
致命错误:local()在执行'git commit -m'更改了prodserver的设置时遇到错误(返回代码2)
$ fab create_branch_deploy_to_prodserver [localhost] run: git checkout prodserver_server [localhost] run: git merge master [localhost] run: cp settings_prodserver.py settings.py [localhost] run: git add settings.py [localhost] run: git commit -m 'changed settings for prodserver' Fatal error: local() encountered an error (return code 1) while executing 'git commit -m 'changed settings for prodserver'' Aborting.
这里如果Fabric功能:
def create_branch_deploy_to_prodserver(): local("git checkout prodserver_server") local("git merge master") local('cp settings_prodserver.py settings.py') # #local('git rm fabfile.py') #This is also creating error so it's commented out local('git add settings.py') local("git commit -m 'changed settings for prodserver'")
是否有可能从Fabric进行git提交?
当我在声明中添加capture = False时,我能够诊断出问题:
local('git rm fabfile.py', capture=False) local('git add settings.py', capture=False)
这样可以更加详细地显示错误.
显然,Fabric的维护者将local
在1.0 中将恢复的行为恢复为默认捕获状态.