在 Azure 上持续部署具有 Git 个子模块的 VSTS 应用程序失败
Continuous Deployment of VSTS app with Git submodules fails on Azure
我正在尝试使用 Azure Web 应用程序中的 Deployment source
选项将包含子模块的 VSTS(Visual Studio 团队服务)Git 应用程序部署到 Azure。
所有子模块都托管在同一个 VSTS 项目中,但在不同的 Git 存储库中。
部署到 Azure 失败并显示以下错误消息:
fatal: could not read Username for 'https://XXX.visualstudio.com': Bad
file descriptor\nClone of
'https://XXX.visualstudio.com/defaultcollection/Project/_git/Project.API.Models'
into submodule path 'lib/api-models' failed\n\r\nD:\Program Files
(x86)\Git\cmd\git.exe submodule update --init --recursive
有什么方法可以将 Git 项目(包括子模块)部署到 Azure?
所以我想出了一个解决方法,让 git 在 Azure 上部署与子模块一起工作。
- 通过在 VSTS 中单击克隆然后单击个人访问令牌来创建个人访问令牌。
- 复制访问令牌并修改
.gitmodules
文件中所有子模块的 URL。
- git 模块的 url 之后应该是这样的:
https://deployment:YOURCOPIEDAPIKEY@XXX.visualstudio.com/defaultcollection/Project/_git/Project.API.Models
确保在所有子模块和子模块的子模块中粘贴 API 键。承诺并推动,你很高兴。
在这种情况下,用户名 deployment
可以是任何随机名称。
我正在尝试使用 Azure Web 应用程序中的 Deployment source
选项将包含子模块的 VSTS(Visual Studio 团队服务)Git 应用程序部署到 Azure。
所有子模块都托管在同一个 VSTS 项目中,但在不同的 Git 存储库中。
部署到 Azure 失败并显示以下错误消息:
fatal: could not read Username for 'https://XXX.visualstudio.com': Bad file descriptor\nClone of 'https://XXX.visualstudio.com/defaultcollection/Project/_git/Project.API.Models' into submodule path 'lib/api-models' failed\n\r\nD:\Program Files (x86)\Git\cmd\git.exe submodule update --init --recursive
有什么方法可以将 Git 项目(包括子模块)部署到 Azure?
所以我想出了一个解决方法,让 git 在 Azure 上部署与子模块一起工作。
- 通过在 VSTS 中单击克隆然后单击个人访问令牌来创建个人访问令牌。
- 复制访问令牌并修改
.gitmodules
文件中所有子模块的 URL。 - git 模块的 url 之后应该是这样的:
https://deployment:YOURCOPIEDAPIKEY@XXX.visualstudio.com/defaultcollection/Project/_git/Project.API.Models
确保在所有子模块和子模块的子模块中粘贴 API 键。承诺并推动,你很高兴。
在这种情况下,用户名 deployment
可以是任何随机名称。