TFS 2010 Build、恒定放置位置、随机访问问题 [英] TFS 2010 Build, constant drop location, random access issue

查看:25
本文介绍了TFS 2010 Build、恒定放置位置、随机访问问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们使用 TFS 2010 Build 在固定位置交付库.( \\server\product-R0\latest )

We are using TFS 2010 Build to deliver libraries on a fixed location. ( \\server\product-R0\latest )

其他团队项目从此位置引用该库.

Other team projects reference the library from this location.

在我的构建过程中,我检查构建和单元测试是否通过,如果没问题我:

On my build process I check if Build and unit tests passed, if it's ok I:

  1. 转换 web/app.config
  2. 使用DeleteDirectory"活动删除最新的文件夹
  3. 使用CreateDirectory"活动创建最新的文件夹
  4. 使用CopyDirectory"活动复制文件夹中的二进制文件

我先删除文件夹,因为如果我们重命名程序集,旧的程序集不会被删除.

I delete the folder first because if we rename an assembly the old one won't be deleted.

该问题是随机的,发生率为 40%:

The issue is random and happen 40% of the time:

TF270002:从以下位置复制文件时出错'D:\Builds\1\FooTeam\BarService\Binaries' 到'\\nas\Builds\BarService-R0\Latest'.

TF270002 : An error occurred copying files from 'D:\Builds\1\FooTeam\BarService\Binaries' to '\\nas\Builds\BarService-R0\Latest'.

详细信息:访问路径'\\nas\Builds\BarService-R0\Latest\SomeFile.dll'被拒绝.

Details : Access to the path '\\nas\Builds\BarService-R0\Latest\SomeFile.dll' is denied.

如果您多次启动构建,它会起作用.

If you launch the build several times it work.

我尝试过在步骤之间进行睡眠以查看会发生什么"的通常愚蠢想法,但它并没有解决问题,它似乎只是降低了它发生的可能性.

I've try the usual dumb idea of "putting sleeps between steps to see what happens" but it don't solve the problem, it just seems to reduce the probability of it happening.

就像TFS在删除目录的同时尝试复制,有时它会在目录创建步骤中挂起.

It's like TFS try to copy while still deleting the directory, some times it hangs on the directory creation step.

有人吗?谢谢!

推荐答案

最优雅的解决方案是创建链接而不是复制,比如

The most elegant solution is to create a link instead of copying, something like

mklink /J D:\Drops\MyBuild_LatestGood D:\Drops\MyBuild_2014-06-13

另外:不涉及复制,相同的 ACL.注意事项:当 Drop 共享位于 Build 服务器上时,此命令仅在本地工作.在 NAS 的情况下也有选项,只要您被允许执行远程命令(例如 SSH).

Plus: No copy involved, same ACLs. Caveats: this command works only locally, when the Drop share is located on the Build server. There are options also in the case of a NAS, as long as you are allowed to execute remote commands (e.g. SSH).

另一种选择是在所需文件夹上创建网络共享,即使磁盘是远程的,只要它驻留在 Windows 服务器上.

Another option is to create a network share on the desired folder, even if the disk is remote, as long as it reside on a Windows server.

这篇关于TFS 2010 Build、恒定放置位置、随机访问问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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