TFS 2010 Build, constant drop location, random access issue

若如初见. 提交于 2020-01-15 07:15:08

问题


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. Transform web/app.config
  2. Delete the latest folder using a "DeleteDirectory" activity
  3. Create the latest folder using a "CreateDirectory" activity
  4. Copy the binaries in the folder using "CopyDirectory" activity

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

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

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

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.

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

Anyone? Thank you!


回答1:


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

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).

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.



来源:https://stackoverflow.com/questions/23991455/tfs-2010-build-constant-drop-location-random-access-issue

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!