在一个单独的构建过程中检入文件后,是否可以绕过Gated Check-In构建? TFS 2010 [英] Can I bypass Gated Check-In build after checking a file in during a separate build process? TFS 2010

查看:59
本文介绍了在一个单独的构建过程中检入文件后,是否可以绕过Gated Check-In构建? TFS 2010的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我为解决方案设置了2个构建定义,其中1个是每晚触发的每晚构建,另一个是Gated Check-In构建,当开发人员尝试将新更改签入源代码控制时将触发.每晚构建使用的是自定义模板,该模板使用从

I have 2 build definitions set up for a solution, 1 is a nightly build that is triggered every night and the other is a Gated Check-In build that will trigger when developers try to check new changes into source control. The nightly build is using a custom template that increases assembly versions using method that has been slightly modified from the Ewald Hoffman method. When a file is checked in via the custom activity to check files in, i get the build error:

您无法完成签入,因为这会影响以下内容 门控构建定义\ Project \ GatedBuld.完成签到 您将需要排队构建货架 Gated_2011-11-08_09.31.42.6934; DOMAIN \ TFSBuildAccount.

Your check-in could not be completed because it affects the following gated build definitions \Project\GatedBuld. To complete your check-in you will need to queue a build of the shelveset Gated_2011-11-08_09.31.42.6934;DOMAIN\TFSBuildAccount.

目前,我还无法找到一种方法来绕过此门控的签入构建(使用* NO_CI *签入注释可阻止CI生成).

At present I have not been able to find a way to bypass this gated check-in build (CI builds are prevented using the *NO_CI* check in comment).

我曾尝试为构建服务帐户设置通过构建覆盖签入验证"权限(通过Gate生成的安全性),但是据我所知,这仅在手动检查代码时才阻止Gate生成. (通过门控值机"对话框中显示的复选框).我正在寻找的是一种在自动检查更改时绕过门控构建的方法

I have tried setting the "Override check-in validation by build" permission for the build service account (via Security for the gated build), but as far as I know this will only prevent the gated build when checking code in manually (via a check box presented in the Gated Check-in dialog). What I'm looking for is a way to bypass a gated build when checking changes in automatically

有什么建议吗?

一如既往,感谢您的提前帮助

As always, thanks for any help in advance

推荐答案

以编程方式签入更改时,可以创建

When you checkin your changes programmatically, you can create a WorkspaceCheckInParameters object and set its OverrideGatedCheckIn property to true. The following code would bypass gated checkin (and also CI):

            var pendingChanges = workspace.GetPendingChanges();
            if (pendingChanges.Any())
            {
                WorkspaceCheckInParameters parameters = new WorkspaceCheckInParameters(pendingChanges, BuildCommonUtil.NoCICheckInComment)
                {
                    OverrideGatedCheckIn = true,
                };
                workspace.CheckIn(parameters);
            }

请注意,您需要授予对所有受影响的构建定义执行检入的帐户绕过门控检入的权限.在这种情况下,它是Nightly构建的构建服务帐户.

Note that you need to grant the permission to bypass gated checkin on the account that performs the checkin for all affected build definitions. In this case, it is the build service account of the Nightly build.

这篇关于在一个单独的构建过程中检入文件后,是否可以绕过Gated Check-In构建? TFS 2010的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆