简体   繁体   English

TFS自动构建和发布的要求

[英]Requirements for TFS automated build and publish

I'm new to TFS and we're trying to automate the test / build / deploy process for our builds. 我是TFS的新手,我们正在尝试自动化构建的测试/构建/部署过程。

The problem I'm experiencing is that when I try to start a build with automatic deployment (for a webpage) using the MSBuild Arguments it complains that it doesn't have the necessary DLLs and I've figured out so far that they get installed with Visual Studio Premium or Ultimate, but then other people complained that something like Visual Studio shouldn't get installed on a Server =) 我遇到的问题是,当我尝试使用MSBuild Arguments启动自动部署(对于网页)的构建时,它抱怨它没有必要的DLL并且我已经想到它们已经安装到目前为止使用Visual Studio Premium或Ultimate,但随后其他人抱怨像Visual Studio这样的东西不应该安装在服务器上=)

The TFS is also the build server for now and I'd like the know if there are any known requirements for these things to work: TFS还是目前的构建服务器,我想知道这些功能是否存在已知要求:

  • Automated UI Testing 自动化的UI测试
  • Automated deployment 自动部署
  • Automated publish 自动化发布
  • Code Analysis 代码分析

I'm working with TFS 2010 and Visual Studio 2010 (Premium). 我正在使用TFS 2010和Visual Studio 2010(Premium)。 Any help, comments or different approaches are welcome =) 欢迎任何帮助,评论或不同的方法=)

The way we handle that on my team is to actually check all the references needed to build the product in to source control. 我们在团队中处理此问题的方法是实际检查将产品构建到源代码管理中所需的所有参考。 Anything beyond the .NET framework itself, and whatever you get for installing a build controller/build agent, gets checked in.. .NET框架本身之外的所有内容,以及安装构建控制器/构建代理所获得的任何内容,都可以签入。

Positive bits: 正位:

  • Setting up a build agent is trivial (just "Install Server 2K8R2, install build agent, start building"). 设置构建代理是微不足道的(只需“安装服务器2K8R2,安装构建代理,开始构建”)。
  • Don't have to worry about complicated SDK installation to match people's dev boxes.. References are all the exact version checked in to source control. 不必担心复杂的SDK安装以匹配人们的开发框。引用是检查到源代码管理的所有确切版本。
  • You get binary version control, which means if you need to do a maintenance release and build against last year's version of a particular API, it's super easy. 你得到二进制版本控制,这意味着如果你需要进行维护版本并针对去年版本的特定API进行构建,那么它非常简单。

Negative bits: 负位:

  • Bloats your source control a bit 夸大您的源代码控制
  • Feels weird checking binaries in to source control 感觉将二进制文件检查到源代码管理中很奇怪
  • Need to be very vigilant about maintaining structure and cleanliness of how you check in the binaries, otherwise it can easily get out of control 需要非常警惕维护结构和清洁度如何检查二进制文件,否则它很容易失控

Beyond that, as far as making the test bits work from your build agent.. Probably the easiest way would be to install the test agent. 除此之外,只要使测试位从构建代理中运行。可能最简单的方法是安装测试代理。 The UI automation stuff in VS2010 is the "CodedUI Test" framework.. It extends the normal VS Unit Test framework, but requires some additional registrations to work. VS2010中的UI自动化内容是“CodedUI测试”框架。它扩展了正常的VS单元测试框架,但需要一些额外的注册才能工作。

More complicated, but super useful longer term is to set up the full "Visual Studio Lab Management" platform. 更复杂但长期有用的是建立完整的“ Visual Studio Lab Management”平台。 Downside is, to fully leverage it you'll need to hook up a System Center Virtual Machine Manager server and at least one Hyper-V host, and build out a virtual machine with a "Clean" VM snapshot (everything except the product you're testing installed). 下行是为了充分利用它,您需要连接System Center Virtual Machine Manager服务器和至少一个Hyper-V主机,并构建一个带有“Clean”VM快照的虚拟机( 除了您的产品之外的所有内容)重新测试安装)。 Once all that's in place you get a really slick end-to-end build-deploy-test experience.. You trigger the product build via the build system, once that completes your environment is restored to that absolutely clean state (no worries about leftover bits from last version corrupting your testing, etc), the product gets published to this test environment, and then it executes your tests. 一旦完成所有这些,您就可以获得非常灵活的端到端构建 - 部署 - 测试体验。您可以通过构建系统触发产品构建,一旦完成,您的环境将恢复到绝对干净的状态(无需担心剩余的状态)来自最新版本的位破坏了您的测试等),产品被发布到此测试环境,然后它执行您的测试。

Not sure if you're using TFS for workitem tracking, testcase management, project planning, and whatnot.. If not, the lab management stuff may be too heavy-weight to mess with. 不确定您是否正在使用TFS进行工作项跟踪,测试用例管理,项目规划等等。如果没有,实验室管理人员的工作量可能太大而且无法解决问题。 More info here if you're interested in messing with that part. 如果您有兴趣将此部分弄混,请在此处获取更多信息。 :) :)

Your build server needs the appropriate versions of Visual Studio. 您的构建服务器需要适当版本的Visual Studio。 For instance, if you want to do database unit tests, then the build server needs VS Ultimate to be installed. 例如,如果要进行数据库单元测试,则构建服务器需要安装VS Ultimate。

If there's an issue with having "client" software installed on a server, then use a separate build server. 如果在服务器上安装“客户端”软件时出现问题,请使用单独的构建服务器。 It makes perfect sense for a build server to have the necessary tools installed to perform builds. 对于构建服务器来说,安装必要的工具来执行构建是非常有意义的。

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

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