简体   繁体   English

一次签入即可触发两个构建定义-持续集成TFS

[英]Trigger two build definition with one check in - Continuous Integration TFS

I have two build definition "A" and "B". 我有两个构建定义“ A”和“ B”。 I marked "A" to be triggered (Gated Check-in) when the check in include files under "src\\ProjectA" and "B" to be triggered when the check in include files under "src\\ProjectB" . 我将签入包含在“ src \\ ProjectA”下的文件标记为“ A”(门控签入),将签入包含在“ src \\ ProjectB”下的文件标记为“ B It's working as expected when the chech-in include only one of the folders. 当chech-in仅包含一个文件夹时,它可以按预期工作。

When the check-in include both of the folder and I click the CkeckIn button in Visual Studio I have to select which build I want to run (I choose "A") and only this build running and all the files are getting in, meaning that some code get into the repository that can break the build that didn't run ("B"). 签入包括文件夹和我都单击Visual Studio中的CkeckIn按钮时,我必须选择我要运行的构建(我选择“ A”),并且只有此构建正在运行并且所有文件都进入了, 这意味着某些代码进入存储库可能会破坏未运行的构建(“ B”)。

How can I make TFS run both builds whenever such a checkin will be delivered and not accept the change if all of the depended build get passed? 每当交付这种签入时,如何使TFS运行两个版本,并且如果所有依赖的版本都通过,则不接受更改?

Each gated check-in build definition can have only one running build at a time. 每个门控的签入构建定义一次只能包含一个正在运行的构建。 If you have two build definitions configured for the same source control folder then you will always get a choice . 如果您为同一源代码管理文件夹配置了两个构建定义,那么您将始终有一个选择 Your situation is very likely configured for the same source control folder. 您的情况很可能是为同一源代码管理文件夹配置的。

It is recommended to have only check in each Project fold instead of check in include both of the folder together to avoid confusion. 建议只检查每个项目折叠,而不要同时检查两个文件夹,以免造成混淆。 As a workaround you could first check in files in folder src\\ProjectA and then exclude others, after the gated check-in build completed, include other files again. 解决方法是,您可以先检入src\\ProjectA文件夹中的文件,然后排除其他文件,在门控检入构建完成后,再次包含其他文件。

For more info of the TFVC gated check-in, you could take a look at James Reed 's answer in this question Can we build multiple gated check-ins in parallel? 有关TFVC门控登机的更多信息,您可以查看James Reed在此问题中的回答, 我们可以并行构建多个门控登机吗?

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

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