What is the purpose of Binaries\_PublishedWebsites directory under TFS build

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-10 15:04:18

问题


TFS generates a publish directory under the build agent working directory:

Z:\TFSBuilds\1\box\CT\Binaries\\_PublishedWebsites

I am supposing that this is where TFS is automatically publishing the site. How can I use it for auto publishing of sites... as Should we refer our IIS website to this directory. What is the purpose of it?


回答1:


Firstly, the working directory is as the name says, a "working" directory. That is where the build agent downloads the source, perform compiles etc. It also clears the working directory whenever you run the build again so you risk grabbing unfinished artifacts when you try to retrieve from the working directory.

TFS defines a "drop folder" that it will copy the final artifacts to, once the build completes. You can define the drop folder for a build by editing it's build definition:

  1. Right click on the build and choose 'edit build definition.
  2. Select the 'Build Defaults' section.
  3. Tick 'This build copies output files to a drop folder'
  4. Enter an UNC path for the build agent to copy artifacts to (make sure the Build Agent has access to that UNC path!)

Secondly, in regard to _PublishedWebsites. The build agent will create a _PublishedWebsites folder for each Web project it builds as part of its build artifacts (so if you tell it to build a solution with 2 web projects, it'll create [Project name A]\_PublishedWebsites and [Project Name B]\_PublishedWebsites). Inside each _PublishedWebsites folder are the contents to be dropped into an IIS application, same as what you would get by right clicking on a web project and selecting 'Publish'. I normally add a last step in the build workflow to copy the contents of this _PublishedWebsites folder to my desired IIS directory.

This link tells you how to add the copy workflow: TFS 2010: Copy _PublishedWebsites to test server

And here's more on drop folders: http://msdn.microsoft.com/en-us/library/bb778394.aspx



来源:https://stackoverflow.com/questions/9097057/what-is-the-purpose-of-binaries-publishedwebsites-directory-under-tfs-build

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