简体   繁体   English

如何使用TFSBuild for MVC应用程序设置连续部署?

[英]how can I set up a continuous deployment with TFSBuild for MVC app?

I have some questions around the best mechanism to deploy MVC web applications to different environments. 我对将MVC Web应用程序部署到不同环境的最佳机制有一些疑问。 Previously I used setup projects (.msi's) but as these have been discontinued in VS2012 I am looking to move to an alternative. 以前,我使用安装项目(.msi),但是由于这些项目已在VS2012中停用,因此我希望使用其他项目。

Let me explain my current setup. 让我解释一下我当前的设置。 I currently have a CI setup using TFSBuild 2010 with Team Foundation Server for source control. 我目前有一个使用TFSBuild 2010和Team Foundation Server进行源代码控制的CI设置。

A number of developers work on their local machines and check in to the TFS Server. 许多开发人员在其本地计算机上工作并签入TFS服务器。 We regularly deploy to a single server dev environment and a load balanced qa environment with 2 servers. 我们定期将其部署到单个服务器开发环境和具有2个服务器的负载均衡质量保证环境。 Our current process includes installing an msi which carries out some of the following custom actions: 我们当前的过程包括安装执行以下一些自定义操作的msi:

  • brings current app offline with the app_offline.htm file 通过app_offline.htm文件使当前应用脱机
  • run in database scripts (from database project in the solution) 在数据库脚本中运行(来自解决方案中的数据库项目)
  • modifies web.config (different for each web server of qa) 修改web.config(每个Qa的Web服务器都不同)
  • labels the code 标记代码
  • warmup each deployed file via http request 通过http请求预热每个部署的文件
  • etc 等等

This is the current process. 这是当前过程。 Now I would like to make some changes. 现在,我想进行一些更改。 Firstly, I need alternative to msi's. 首先,我需要替代msi。 From som research I believe that web deploy via IIS and using MsDeploy is the best alternative. 通过Som研究,我认为通过IIS并使用MsDeploy进行Web部署是最好的选择。 I can use web config transforms for web config modifications. 我可以使用Web配置转换进行Web配置修改。 Is this correct and if so, could I get an outline of what I need to do? 这是正确的吗?如果是这样,我能概述一下我需要做什么吗?

Secondly I want to set up continuous delivery via TFSBuild, I have no idea how this may be achieved, would it be possible to get an outline of how it can be integrated in to my current setup? 其次,我想通过TFSBuild设置连续交付,我不知道如何实现这一目标,是否有可能概述如何将其集成到当前设置中? Rather than check in driven, I would like it to be user driven following check in. Also, would it be possible for this to also run in database scripts from a database project in the solution. 我希望它不是由签入驱动,而是希望由签入后由用户驱动。此外,是否有可能在解决方案中的数据库项目中以数据库脚本的形式运行它。

Finally, there is also a production environment, but I would like to manually deploy this - can my process also produce an artifact that I can manually install? 最后,还有一个生产环境,但是我想手动部署它-我的过程还能产生一个我可以手动安装的工件吗?

Vishal Joshi has some information on his blog that is reasonably good, http://vishaljoshi.blogspot.com/2010/11/team-build-web-deployment-web-deploy-vs.html . 维沙尔·乔希(Vishal Joshi)在他的博客上提供了一些相当不错的信息, 网址为http://vishaljoshi.blogspot.com/2010/11/team-build-web-deployment-web-deploy-vs.html It does have the downside that your deployment password is include in the properties you pass to msbuild. 它的缺点是您的部署密码包含在传递给msbuild的属性中。

Syed Hashimi has also posted some information on this in another questions Team Build: Publish locally using MSDeploy . Syed Hashimi还在团队构建的另一个问题:使用MSDeploy在本地发布中发布了有关此的一些信息。

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

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