git - 在 Azure 上使用 Git 子模块持续部署 VSTS 应用程序失败

标签 git azure azure-web-app-service git-submodules continuous-deployment

我正在尝试使用 Azure Web 应用中的部署源 选项将包含子模块的 VSTS (Visual Studio Team Services) 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?

最佳答案

因此,我找到了一种解决方法,可以让 Azure 上的 git 部署与子模块一起使用。

  1. 通过点击 VSTS 中的克隆,然后点击个人访问 token 来创建个人访问 token 。
  2. 复制访问 token 并修改 .gitmodules 中所有子模块的 URL文件。
  3. git 模块的 url 应该如下所示:https://deployment:<a href="https://stackoverflow.com/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="f0a9bfa5a2b3bfa0b9b5b4b1a0b9bbb5a9b0a8a8a8de86998385919c83848594999fde939f9d" rel="noreferrer noopener nofollow">[email protected]</a>/defaultcollection/Project/_git/Project.API.Models

确保将 API key 粘贴到所有子模块以及子模块的子模块中。 promise 并 push ,你就可以开始了。 用户名deployment在这种情况下可以是任何随机名称。

关于git - 在 Azure 上使用 Git 子模块持续部署 VSTS 应用程序失败,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37657278/

相关文章:

git - Bitbucket 无法 checkout Sourcetree 中的存储库

php - 在发生 fatal error 后重新创建 Git Ref

oracle - 捕获 Azure 中 Oracle DB 的插入、更新和删除事件

azure - 我可以在没有自定义域的情况下在 Azure 应用服务上使用客户端证书吗?

git - 无需提交即可恢复git repo中的文件

git - 如何调试 git-cvsimport? (看不到复杂的提交)

asp.net - 使用 Azure Active Directory 进行单点登录

c# - 使用 pulumi 运行 EF Core 迁移

Azure 应用服务 - REST API 在 url 参数中带有斜杠

angular - 尝试连接到节点在 60000 毫秒后超时