使用 NAnt、MSBuild 或任何其他工具在构建上发布 Web 应用程序

发布于 2024-08-17 10:13:53 字数 143 浏览 3 评论 0原文

我有一个场景,我必须设置一个测试环境,我希望能够告诉我的 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

糖粟与秋泊 2024-08-24 10:13:53

有多种方法可以解决此问题:

  1. 在测试环境中设置持续集成 (CI) 服务器。如果您的测试环境机器不经常更改并且它是一台机器,那么这是一个可行的选择。
  2. 从开发计算机推送安装
  3. 使用 PsExec 等工具 二:您有一个构建 CI 服务器,它将安装推送到(多个)测试环境。

当然,您还需要一个好的构建脚本来设置 IIS 应用程序(NAnt 为此提供了任务)。可以通过 CI 服务器(CruiseControl.NET 电子邮件发布器,哈德森...)。

我建议花一些时间阅读这个优秀的文章系列:面向人民的自动化:部署-自动化模式

There are several ways to approach this:

  1. Set up a continuous integration (CI) server on the test environment. This is a viable option if your test environment machine doesn't change often and it's a single machine.
  2. Push the installation from your development machine using tools like PsExec
  3. Combination of the two: you have a build CI server which pushes the installation to (multiple) test environments.

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

半衾梦 2024-08-24 10:13:53

我们的 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!

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文