与 asp.net 一起使用的良好构建自动化和部署流程是什么?
我正在寻找一些自动进行项目构建和部署的建议。
我们当前的开发设置使用 ASP.NET、SVN、CCNET 和 MSBuild 脚本来构建开发服务器。我正在考虑切换到 Cruise 而不是 CCNET,尽管我不确定这是否会给我带来任何我还没有的额外功能。
我想要自动化的是从自动化构建完成后到使用新更改更新实时站点的过程。站点更新可以包括基础站点更新以及客户端更新,这些更新可以是代码和/或数据库更改,因此该过程需要足够灵活,以便能够处理这些情况。
我的灵感来源之一来自 这个视频以及每个月花费无尽的时间进行更新。
I’m looking for some recommendations to do project building and deployment automatically.
Our current development setup uses ASP.NET, SVN, CCNET and an MSBuild script for the dev server build. I was thinking of switching over to Cruise instead of CCNET though I’m not sure if that gives me anything extra that I don’t have already.
What I’d like to automate is the process from after an automated build is done to updating the live site with the new changes. Site updates can include base site updates as well as client updates which can be code and/or database changes so the process needs to be flexible enough so it can handle those scenarios.
One of my sources of inspiration for this came from this video as well as the endless hours spent doing updates each month.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
对于较小或个人项目,我建议使用免费(且优秀)之类的东西JetBrains 的 TeamCity。单元测试自动化、持续集成以及构建后发生的情况的规则(包括将其移动到不同的位置)。
对于较大的团队,我实际上发现了一些以自定义 MSBuild 任务形式实现的构建自动化,而 RoboCopy 效果最好。手动提升环境之间的构建与使用 MSBuild 和 MSBuild 之间的这种完美组合RoboCopy 自动化了该过程的一部分,在环境之间创建了清晰的中断(很少有“哎呀,我不是故意把它推到那里”的错误)。它还允许我们在推广之前进行质量检查审核。
更新 7/31/2014:
我使用过 自定义 TFS 构建模板 成功。它们有点复杂,但是您可以用它们做很多很酷的事情。
对于 GitHub 上托管的开源项目(如 NuGet 库),我认为您无法击败 AppVeyor。我有一些项目,例如 Mailchimp.NET ,它们具有完整的构建和 NuGet 部署自动化。
For smaller or personal projects, I would recommend using something like the free (and excellent) TeamCity by JetBrains. Unit test automation, continuous integration, and rules for what happens after a build (including moving it around to different locations).
For larger teams, I've actually found a bit of build automation in the form of custom MSBuild tasks and RoboCopy works best. This nice combination between manually promoting builds between environments and using MSBuild & RoboCopy to automate parts of this process creates clean breaks between environments (with very few 'oops I didn't mean to push that there' mistakes). It also lets us have QA review builds before promoting.
Update 7/31/2014:
I've used custom TFS build templates with success. They're a bit complicated, but you can do quite a few cool things with them.
For open source projects (like NuGet libraries) hosted on GitHub, I don't think you can beat AppVeyor. I've got a few projects like Mailchimp.NET that have complete build and NuGet deploy automation.
听起来部署代码更改的两个主要功能是:1. 复制文件和 2. 执行 DB 脚本更改。如果您考虑使用 MsBuild 社区任务,有很多方便的构建任务可以为您提供帮助。 SqlExecute 和 RoboCopy 听起来好像您只需要使用它们。这将需要您修改项目文件以扩展其构建行为,但是一旦完成,您就可以“编写”正在完成的手动部分。
Sounds like the two major functions for deploying your code changes is: 1. Copying files and 2. Executing DB Script Changes. If you look at using MsBuild Community Tasks there are plenty of handy build tasks that can help you along the way. SqlExecute and RoboCopy sound like they would be all you would need to use. This would require you modifying your project files to extend their build behavior but once that is done you'd be able to "script" out the manual portion of what is being done.
我过去曾使用 Nant 来完成类似的任务,并且很幸运。您可以使用自动构建来启动它。 (http://nant.sourceforge.net/)
如果您想要更全面的内容,可以查看 wix (http://wix.sourceforge.net/)
现在您真的确定自动构建会启动所有内容吗关闭 您想更新实时站点吗?或者您的意思是您使用 cc 工具启动构建,然后它生成一个要上线的构建?
当有人签入文件的新版本时,我不想更新实时站点。
您的数据库更新可能是最具挑战性的方面。不过,只要数据库更新签入的是更改脚本,就还不错。
I have used Nant in the past with a lot of luck for similar tasks. You can kick it off using your automated build. (http://nant.sourceforge.net/)
If you want something more comprehensive you can check out wix (http://wix.sourceforge.net/)
Now are you really sure that everything an autmatic build kicks off you want to update the live site? Or do you mean that you kick off a build, using your cc tool, and then it generates a build to go live?
I would hate to have the live site update when somebody checked in a new version of a file.
Your database updates will probably be the most challenging aspect. However as long as what is checked in for the databvase update is a change script, it is not bad.