让 MSDeploy 在我们的构建/集成服务器上运行 - 是否需要 MSBuild 升级?

发布于 2024-08-27 22:51:54 字数 634 浏览 4 评论 0原文

我们有一个我认为相当标准的构建流程: 1. 开发者:签入代码 2. 构建:轮询存储库,查看更改,然后启动构建: 3. 构建:从存储库更新、使用 MSBuild 构建、使用 nunit 运行单元测试、 4. 构建:创建安装程序包

我们的安全团队允许我们从构建服务器拉取,但不允许构建服务器推送。因此,我们通常 rdp in、d/l 安装程序并运行它们,这排除了灵活的部署服务,因此我需要生成包。我想使用 MSDeploy,但我们有以下问题:

  1. 我们使用的是 .net 3.5,而使用 MSDeploy 的 MSBuild 目标(包)需要 4.0。除了 .net 4.0 RC 之外,我还需要安装什么吗? (MSBuild 会成为升级的一部分吗?)
  2. 当我使用 MSDeploy 生成包时,我发现我不只有 1 个文件。其中有 zip、deploy.cmd、SourceManifest.xml 和 SetParameters.xml。所有其他文件的用途是什么,为什么它们不都在“包”中?
  3. 听起来好像您可以通过告诉系统查看正在运行的 IIS 站点来创建包。但是,如果这些包是从 CI 环境构建的,那么您是否基本上不走运?感觉他们是为从他们的开发环境中部署的小规模开发人员设计的。这是一个很好的用例,但我有兴趣了解每个人对该工具的企业体验有什么

建议吗?

We have what I think is a fairly standard build process:
1. Developer: Check in code
2. Build: Polls repo, sees change, and kicks off build that:
3. Build: Updates from repo, Builds w/ MSBuild, Runs unit tests w/ nunit,
4. Build: creates installer package

Our security team allows us to pull from the build server, but does not allow the build server to push. So we generally rdp in, d/l the installers, and run them, which rules out the slick deployment services, so I would need to generate packages instead. I'd like to use MSDeploy, except that we have the following issues:

  1. We're on .net 3.5, and the MSBuild target (Package) that uses MSDeploy requires 4.0. Is there anything I'd need to install other than .net 4.0 RC for this? (Would MSBuild be part of that upgrade?)
  2. When I generate packages with MSDeploy, I see that I don't have just 1 file. There's a zip, deploy.cmd, SourceManifest.xml, and SetParameters.xml. What are all the other files for, and why wouldn't they all be in the 'package'?
  3. It sounds as if you can create packages by telling the system to look at a working IIS site. But if the packages are build from a CI environment, aren't you basically out of luck here? It feels like they designed some of this for small-scale developers deploying from their dev environment. That's a fine use case, but I'm interested in see what everyone's enterprise-experience is with the tool

Any suggestions?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

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

发布评论

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

评论(1

dawn曙光 2024-09-03 22:51:54

如果您的应用程序没有使用 Visual Studio 2010,那么我建议您选择以下选项之一:

  1. 使用 msdeploy.exe
  2. 在构建服务器上安装 Visual Studio 2010 并使用 MSDeploy 任务本身

让我再解释一下。

选项 1

MSDeploy 本身不依赖于 MSBuild,因此您可以将其单独安装在构建服务器上来为您创建包。您可以从此处下载它。之后,您可以使用 Exec 任务创建 MSBuild 部署脚本来调用msdeploy.exe 以及用于创建包的命令。

关于第二个选项

.targets 文件以及 MSDeploy 的任务不是使用 .NET 框架部署的,而是使用 Visual Studio 2010 本身部署的。因此,如果您想利用其中任何一个,您必须在构建服务器上安装 VS 2010。

您在帖子中提到使用包目标。您将无法使用它,因为该目标是 .NET 4 项目的更大构建过程的一部分。您可以做的是创建一个单独的 MSBuild 文件(与您的项目文件不同),该文件使用 MSBuild 4 调用随 VS 2010 for Web 提供的任务部署。

在这里我专门回答您的编号列表

  1. 您必须安装 Visual Studio 2010,因为这些任务是随 VS 本身而不是框架附带的。
  2. 这些文件用于与您的包进行交互。您的程序包将您的应用程序作为一个整体呈现。 deploy.cmd 将调用 msdeploy.exe 来为您执行部署。 SourceManifest.xml 和 SetParameters.xml 用于自定义应用程序的部署。调用 msdeploy.exe 时,deploy.cmd 将使用这些文件。换句话说,如果您想要自定义 Web 应用程序的安装路径,您可以在 SetParameters.xml 中设置该路径以及其他选项。
  3. 您的权利设置可以来自 IIS,但许多开发人员更喜欢使用 VS 应用程序服务器而不是 IIS。这是我的偏好。在这种情况下,我建议将您的应用程序部署到您将用作模板的环境中。进行所需的所有 IIS 设置,创建 MSDeploy 包,然后从包中获取 archive.xml 文件,并在创建自己的包时使用该文件。另一种选择是设置构建过程可以部署到的 IIS 服务器,然后使用 MSDeploy 同步组成应用程序的文件,然后再次从该 IIS 服务器生成包。

If you are not using Visual Studio 2010 for your application then I would suggest that you pick one of the following:

  1. Use msdeploy.exe
  2. Install Visual Studio 2010 on your build server and us the MSDeploy tasks themselves

Let me explain it a bit more.

Option 1

MSDeploy itself has no dependency on MSBuild so you could install it by itself on your build server to create the packages for you. You can download it from here. After that you can create an MSBuild deployment script using the Exec task to call msdeploy.exe with the command to create your package.

About the second option

The .targets files as well as the tasks for MSDeploy are not deployed with the .NET framework, but with Visual Studio 2010 itself. So if you wanted to leverage any of those you would have to install VS 2010 on your build server.

You mentioned using the Package target in your post. You won't be able to use that because that target is a part of a bigger build process for .NET 4 projects. What you could do is to create a separate MSBuild file (separate as in not your project file) which uses MSBuild 4 to call the tasks that are delivered with VS 2010 for Web Deployment.

Here I answer your numbered list specifically

  1. You would have to install Visual Studio 2010 since those tasks are shipped with VS itself and not the framework.
  2. These files are used to interact with your package. Your package presents your application as a whole. The deploy.cmd will invoke msdeploy.exe to perform the deployment for you. SourceManifest.xml and SetParameters.xml are used to customize the deployment of your app. deploy.cmd will use those files when invoking msdeploy.exe. In other words if you want to customize the path to where the web application would be installed you would set that in SetParameters.xml along with other options.
  3. Your right the settings can come from IIS, but many developers prefer to use the VS application server instead of IIS. That is my preference. What I would suggest in this case is to deploy your application to an environment which you will use as a template. Make all the IIS settings that you need, create your MSDeploy package and then grab the archive.xml file from the package and use that when you create your own package. Another option is to setup an IIS server which your build process could deploy to, then use MSDeploy to just sync the files that makeup your app, and then once again to generate the package from that IIS server.
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文