自动部署 Web 应用程序? [英] Automate Deployment for Web Applications?

查看:48
本文介绍了自动部署 Web 应用程序?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的团队目前正在尝试自动部署我们的 .Net 和 PHP 网络应用程序.我们希望简化部署,避免手动部署带来的麻烦和许多麻烦.

My team is currently trying to automate the deployment of our .Net and PHP web applications. We want to streamline deployments, and to avoid the hassle and many of the headaches caused by doing it manually.

我们需要一个解决方案,使我们能够:

We require a solution that will enable us to:

- Compile the application  
  - Version the application with the SVN version number
  - Backup the existing site
  - Deploy to a web farm

我们所有的应用程序都使用 SVN 进行源代码控制,我们的 .Net 应用程序使用 CruiseControl.我们一直在尝试使用 MSBuild 和 NAnt 部署脚本,但收效甚微.我们过去也使用过 Capistrano,但希望尽可能避免使用 Ruby.

All our apps are source controlled using SVN and our .Net apps use CruiseControl. We have been trying to use MSBuild and NAnt deployment scripts with limited success. We have also used Capistrano in the past, but wish to avoid using Ruby if possible.

还有其他可以帮助我们的部署工具吗?

Are there any other deployment tools out there that would help us?

推荐答案

谢谢大家的好建议.我们检查了所有这些,但经过仔细考虑后,我们决定将 CruiseControl、NAnt、MSBuild 和 MSDeploy 结合起来推出自己的产品.

Thank you all for your kind suggestions. We checked them all out, but after careful consideration we decided to roll our own with a combination of CruiseControl, NAnt, MSBuild and MSDeploy.

这篇文章有一些重要的信息:将 MSBuild 与 CruiseControl.NET 集成

This article has some great information: Integrating MSBuild with CruiseControl.NET

以下是我们解决方案的大致工作原理:

Here's roughly how our solution works:

  • 开发人员构建应用的调试"版本并运行单元测试,然后签入 SVN.
  • CruiseControl 看到更新并调用我们的构建脚本...
    • 在构建数据库上运行任何新的迁移
    • 用构建服务器配置替换配置文件
    • 构建应用的调试"配置
    • 运行所有单元和集成测试
    • 构建应用的部署"配置
      • 使用当前主要/次要版本和 SVN 修订版对 DLL 进行版本控制,例如1.2.0.423
      • 将此新构建移动到我们构建服务器上的发布"文件夹
      • 删除不需要的文件

      然后,当我们确认一切都准备好进行直播/登台时,我们运行另一个脚本:

      Then when we have verified everything is ready to go up to live/staging we run another script to:

      • 在实时/临时服务器上运行迁移
      • MSDeploy:存档当前的实时/临时站点
      • MSDeploy:将站点从构建同步到实时/暂存

      到这个阶段还不是很顺利,但现在大部分时间都在发挥作用:D

      It wasn't pretty getting to this stage, but it's mostly working like a charm now :D

      随着我们对流程进行更改,我将尝试更新此答案,因为现在似乎有几个关于 SA 的类似问题.

      I'm going to try and keep this answer updated as we make changes to our process, as there seem to be several similar questions on SA now.

      这篇关于自动部署 Web 应用程序?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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