[英]Saving build definition is giving error in Visual Studio Team Service
I have started build automation using vs team service. 我已经使用vs团队服务开始构建自动化。 I have linked my github repositories with Visual Studio Team Services through personal access token.
我已经通过个人访问令牌将我的github存储库与Visual Studio Team Services相关联。
Now I am able to select github repositories in Visual Studio Team Services. 现在我可以在Visual Studio Team Services中选择github存储库。 But while saving build definitions it is giving following error:
但是在保存构建定义时,它会给出以下错误:
Unable to configure a service on the selected GitHub repository.
无法在选定的GitHub存储库上配置服务。 This is likely caused by not having the necessary permission to manage hooks for the selected repository.
这可能是由于没有必要的权限来管理所选存储库的挂钩。
Can anyone please help me how to resolve this error. 任何人都可以帮我解决这个错误。 Do we need to buy any service for build automation?
我们是否需要为构建自动化购买任何服务?
Thanks in advance. 提前致谢。
There's another situation that also provokes this issue, specifically related to configuring the Continuous Integration trigger. 还有另一种情况也会引发此问题,特别是与配置持续集成触发器有关。
I have a github account with my own repos, but I'm also a collaborator on a different project (which is a personnel not an organization repo). 我有一个github帐户和我自己的回购,但我也是一个不同项目的合作者(这是一个人员而非组织回购)。
GH allows me to create a personal access token and VSO considers it valid for use when configuring the Repository options on the build definition but it does not have the appropriate rights to create a Continuous Integration trigger acting as collaborator to the other private repo. GH允许我创建个人访问令牌,VSO认为它在构建定义上配置存储库选项时有效,但它没有相应的权限来创建作为其他私有存储库的协作者的持续集成触发器。
The reason is that triggering notification is performed using GitHub Web Hooks . 原因是使用GitHub Web Hooks执行触发通知。 It appears that when first creating the CI trigger, VSO initiates a request into the GH API to subscribe to the
push
event for the requested repo ... except that the personal access token includes the admin:repo_hook
right for your own repo(s), not any for which you are a collaborator as this right cannot be delegated for a personal account. 看来,当第一次创建CI触发器时,VSO向GH API发起请求以订阅所请求的repo的
push
事件...除了个人访问令牌包括admin:repo_hook
权限用于您自己的repo(s) ,不是您作为合作者的任何一方,因为此权利不能委托给个人帐户。
It took me a bit of experimentation to figure this out. 我花了一些实验来解决这个问题。 8-}
8}
Within this context, I think there are two possible solutions: 在这种情况下,我认为有两种可能的解决方案:
HTH. HTH。
You can only build the github repositories hosted in VS Team Service which you are authorized to push to. 您只能构建您有权推送到的VS Team Service中托管的github存储库。
Two ways: 两种方式:
On the Repository tab, next to the Connection drop-down, click the Manage link. 在“存储库”选项卡上的“连接”下拉列表旁边,单击“管理”链接。 The Services tab opens as a new tab in your browser.
“服务”选项卡将作为浏览器中的新选项卡打开。
a.Click New Service Endpoint and choose GitHub. a。单击New Service Endpoint并选择GitHub。
b.In the Add New GitHub Service Connection dialog box, select Grant authorization, and then click Authorize. b。在“添加新GitHub服务连接”对话框中,选择“授予授权”,然后单击“授权”。
c.In the new browser window, sign in to GitHub and follow the instructions to authorize Visual Studio Team Services to access your GitHub account. c。在新的浏览器窗口中,登录GitHub并按照说明授权Visual Studio Team Services访问您的GitHub帐户。
On the Repository tab, select the Connection you created. 在“存储库”选项卡上,选择您创建的“连接”。
Select the Repository that contains the code you want to build. 选择包含要构建的代码的存储库。
In GitHub, create an access token. 在GitHub中,创建一个访问令牌。
a.Select the repo, user, and admin:repo_hook scopes. a。选择repo,user和admin:repo_hook范围。
b.Copy the token to your clipboard. b。将令牌复制到剪贴板。
Sign on to Team Services and create a build definition. 登录Team Services并创建构建定义。
On the Repository tab, next to the Connection drop-down, click the Manage link. 在“存储库”选项卡上的“连接”下拉列表旁边,单击“管理”链接。 The Services tab opens as a new tab in your browser.
“服务”选项卡将作为浏览器中的新选项卡打开。
a.Click New Service Endpoint and choose GitHub. a。单击New Service Endpoint并选择GitHub。
b.In the Add New GitHub Service Connection dialog box, select Personal access token. b。在“添加新GitHub服务连接”对话框中,选择“个人访问令牌”。
c.Paste the token and give the connection a name. c。粘贴令牌并为连接命名。
On the Repository tab, select the Connection you created. 在“存储库”选项卡上,选择您创建的“连接”。
Select the Repository that contains the code you want to build. 选择包含要构建的代码的存储库。
More details you can refer the link from MSDN: Specify the repository - GitHub 更多细节,您可以参考MSDN中的链接: 指定存储库 - GitHub
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.