您可以在 TFS 2010 中对构建-部署-测试工作流进行排队吗? [英] Can you queue Build-Deploy-Test workflows in TFS 2010?

查看:30
本文介绍了您可以在 TFS 2010 中对构建-部署-测试工作流进行排队吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直在使用 TFS 2010 的构建-部署-测试构建工作流(参见此处 http://msdn.microsoft.com/en-us/vstudio/gg131922.aspx) 并且想知道是否有一种方法可以将其中的一个或多个排队以在同一台上运行实验室环境?

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?

通过修改构建模板,我想出了一个脆弱但(大部分)有效的解决方案.每当工作流启动时,我都会设置正在使用的环境"标志,任何后续工作流都会循环并等待标志被清除.

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?

推荐答案

在 TFS 2010 中无法立即执行此操作;微软的艾伦证实了这一点(见评论).

There is no way to do this out-of-the-box with TFS 2010; this confirmed by allen from Microsoft (see comments).

我通过实施自定义构建活动更令人满意地解决了这个问题,该活动维护使用特定实验室环境的所有构建的内存寄存器.我使用 DefaultLabTemplate 的修改版本与此活动交互,等待开始构建,直到配置的实验室环境可用.

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.

该解决方案绝不是完美的,因为它不会扩展到单个构建控制器之外,但足以满足我组织的需求!

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!

这篇关于您可以在 TFS 2010 中对构建-部署-测试工作流进行排队吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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