结构错误:致命错误:执行“git commit -m”消息“时,local() 遇到错误(返回代码 2)”
我正在尝试设置 fabfile 来部署我的 Django 应用程序。
我不明白为什么会出现此错误:
致命错误:执行“git commit -m '更改了 prodserver 的设置”时,local() 遇到错误(返回代码 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 提交?
I'm trying to setup a fabfile to deploy my Django app.
I can't figure out why I'm getting this error:
Fatal error: local() encountered an error (return code 2) while executing 'git commit -m 'changed settings for prodserver'
$ 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.
Here if the Fabric function:
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'")
Is it possible to make a git commit from Fabric?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
当我在声明中添加 capture=False 时,我能够诊断问题:
这允许更详细地显示错误。
显然,Fabric 的维护者将在 1.0 中将
local
的行为恢复为默认不捕获。I was able to diagnose the issue when I added capture=False to the declaration:
This allowed the error to be displayed more verbosely.
Apparently, the maintainer of Fabric will to revert
local
's behavior back to not capturing by default, in 1.0.这是一个与 python 相关的问题,就像 此线程中描述的问题一样?
fabfile_runner.py
Is this a python-related issue like the one described in this thread?
fabfile_runner.py