简体   繁体   English

您可以在TFS 2010中排队进行Build-Deploy-Test工作流吗?

[英]Can you queue Build-Deploy-Test workflows in TFS 2010?

I have been using the Build-Deploy-Test build workflow for TFS 2010 (see here http://msdn.microsoft.com/en-us/vstudio/gg131922.aspx ) and would just like to know if there is a way you can queue one or more of these to run on the same lab environment? 我一直在使用TFS 2010的“构建-部署-测试”构建工作流(请参见http://msdn.microsoft.com/zh-cn/vstudio/gg131922.aspx ),只是想知道您是否有办法可以将其中的一个或多个排队在同一实验室环境中运行?

I have come up with a brittle but (mostly) working solution to this by modifying the Build Template. 我通过修改构建模板提出了一个脆弱但(主要)可行的解决方案。 I set the 'environment in use' flag whenever the workflow starts, and any subsequent workflows loop and wait for the flag to be cleared. 每当工作流启动时,我都会设置“使用中的环境”标志,随后的任何工作流都会循环并等待该标志被清除。

My solution works most of the time, but occasionally I experience race conditions and both workflows try to start at the same time, one 'winning' and reverting the environment to a test-ready snapshot first. 我的解决方案在大多数情况下都有效,但是有时我会遇到比赛条件,并且两个工作流程都尝试同时启动,一次“取胜”,然后将环境首先还原为可测试的快照。

As you can tell, this is a poor solution but a quick one! 如您所知,这是一个糟糕的解决方案,但却是一个快速的解决方案! Is there a proper way to queue Build-Deploy-Test workflows on an environment? 是否有适当的方法在环境中排队“构建-部署-测试”工作流?

There is no way to do this out-of-the-box with TFS 2010; TFS 2010没有现成的方法。 this confirmed by allen from Microsoft (see comments). 微软的艾伦证实了这一点(见评论)。

I solved this issue more satisfactorily by implementing a custom build activity that maintains an in-memory register of all builds using a particular lab environment. 我通过实施自定义构建活动(使用特定的实验室环境维护所有构建的内存中寄存器)来更加令人满意地解决了该问题。 I interact with this activity using a modified version of the DefaultLabTemplate, waiting to start the build until the configured lab environment becomes available. 我使用DefaultLabTemplate的修改版本与此活动进行交互,等待开始构建,直到配置的实验室环境可用为止。

The solution is by no-means perfect, as it does not scale beyond a single build controller but works sufficiently for the needs of my organisation! 该解决方案绝对不是完美的,因为它不能扩展到单个构建控制器之外,但足以满足我的组织的需求!

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

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