简体   繁体   English

带有Git子模块的VSTS应用程序的连续部署在Azure上失败

[英]Continuous Deployment of VSTS app with Git submodules fails on Azure

I am trying to deploy a VSTS (Visual Studio Team Services) Git app including submodules to Azure using the Deployment source option in the Azure web app. 我正在尝试使用Azure Web应用程序中的Deployment source选项将包括子模块的VSTS(Visual Studio Team Services)Git应用程序Deployment source到Azure。

All submodules are hosted in the same VSTS project but under different Git repositories. 所有子模块都托管在同一VSTS项目中,但位于不同的Git存储库下。

The deployment to Azure fails with the following error message: 部署到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 致命:无法读取“ https://XXX.visualstudio.com ”的用户名:错误的文件描述符\\ n“ https://XXX.visualstudio.com/defaultcollection/Project/_git/Project.API.Models ”的克隆到子模块路径'lib / api-models'失败\\ n \\ r \\ nD:\\ Program Files(x86)\\ Git \\ cmd \\ git.exe子模块更新--init --recursive

Is there any way to deploy Git projects including submodules to Azure? 有什么方法可以将包括子模块的Git项目部署到Azure?

So I figured out a workaround on how to make git deployments on Azure work with submodules. 因此,我想出了一种解决方法,该方法如何使Azure上的git部署与子模块一起使用。

  1. Create a personal access token by clicking on clone in VSTS and then personal access token. 通过单击VSTS中的克隆,然后单击个人访问令牌来创建个人访问令牌。
  2. Copy the access token and modify the URL of all submodules in the .gitmodules files. 复制访问令牌并修改.gitmodules文件中所有子模块的URL。
  3. The url of the git modules should look like this afterwards: https://deployment:YOURCOPIEDAPIKEY@XXX.visualstudio.com/defaultcollection/Project/_git/Project.API.Models git模块的url之后应如下所示: https://deployment:YOURCOPIEDAPIKEY@XXX.visualstudio.com/defaultcollection/Project/_git/Project.API.Models

Make sure you paste the API key in all submodules and submodules of submodules. 确保将API密钥粘贴到子模块的所有子模块和子模块中。 Commit and push and you are good to go. 承诺并推动,您就可以开始了。 The username deployment in this case can be any random name. 在这种情况下,用户名deployment可以是任何随机名称。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM