使用 NAnt、MSBuild 或任何其他工具在构建上发布 Web 应用程序
我有一个场景,我必须设置一个测试环境,我希望能够告诉我的 NAnt 或其他构建工具创建一个新的 IIS Web 应用程序,将最新的 bin 放入新创建的 IIS Web 应用程序中,然后向我发布电子邮件,其中包含新应用程序的新地址和端口,这是否可能以及如何实现?哪个工具?
I have a scenario where I have to setup a test environment where I want to be able to tell my NAnt or other build tool to make an new IIS web application, put the latest bins in the newly created IIS web application, and post me an email where the new address and port where the new application are addressed, is this possible and how? which tool?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
有多种方法可以解决此问题:
当然,您还需要一个好的构建脚本来设置 IIS 应用程序(NAnt 为此提供了任务)。可以通过 CI 服务器(CruiseControl.NET 电子邮件发布器,哈德森...)。
我建议花一些时间阅读这个优秀的文章系列:面向人民的自动化:部署-自动化模式
There are several ways to approach this:
Of course, you also need a good build script which will set up the IIS application (NAnt offers tasks for this). Emailing to you can be done by CI server (CruiseControl.NET Email Publisher, Hudson...).
I suggest taking some time to read this excellent article series: Automation for the people: Deployment-automation patterns
我们的 CruiseControl .Net 构建服务器正是这样做的,作为其 NAnt 构建脚本过程的一部分...
一旦从源代码控制中检索到代码,就会依次构建/编译它。然后,Web 项目的处理方式与普通 .dll 略有不同,因为它们被部署到特定文件夹(在当前计算机上或其他位置),其中 IIS(也由脚本设置)为页面提供服务。
诚然,我们使用虚拟目录,而不是在服务器上创建和处置新的网站实例,否则我们必须管理每个网站的端口号。
NAnt 具有完成所有 IIS 工作以及所有电子邮件工作的能力 - 我当然建议您查看这种查询途径来解决您的问题。另外,在您的案例中,您还可以获得持续集成方面的附带好处!
Our CruiseControl .Net build server does exactly this as part of it's NAnt build-script process...
Once the code is retrieved from source control, it's all built/compiled in turn. Web projects are then handled slightly differently to normal .dlls, as they are deployed to a particular folder (either on the current machine or otherwise) where IIS (also set-up by the script) to serve the pages.
Admittedly, we're using Virtual Directories instead of creating and disposing of new website instances on the server, as otherwise we'd have to manage the port numbers for each website.
NAnt has the capabilities of doing all of this IIS work, as well as all of the email work too - I'd certainly recommend looking at this avenue of enquiry to solve your problem. Plus, you also get the continous integration aspect as a side-benefit in your case!