aspnet 部署工具的最佳组合

发布于 2024-11-17 15:35:40 字数 702 浏览 7 评论 0原文

我知道有多少人问过这个问题,但我仍然不知道我的问题的答案。

我需要部署一个 ASP.NET 4.0 站点,并且我想做这样的事情:

  1. 获取整个解决方案的最新版本 - 一个网站和 web 应用程序使用的几个类项目(我已经使用 CCNet 执行此操作 -不是问题)
  2. 在调试配置中构建并部署到测试站点
  3. 在发布配置中构建并部署到暂存站点
  4. 如果暂存站点上的一切看起来都很好,我将运行一个脚本,将发布构建暂存站点部署到 7 -8个类似网站不同客户在同一服务器上使用。将来这将在另一台服务器上。

有 MSDeploy (webdeploy 2.0)、aspnet_compiler、MSBuild、Powershell(我选择的武器..),可能还有更多......我不是 100% 确定在哪里使用什么?

我很乐意模仿 Vs2010 GUI 辅助部署中的“仅部署运行该站点所需的文件”,并且我希望能够不触及我们部署到的网站中的某些现有文件夹。

我觉得我应该经常使用 MSDeploy...但我发现它很难获取。我正在 IIS.NET 上阅读,并且听到了 Scott Hanselman/Jon Arild Tørresdal 的播客。我不是 100% 确定从哪里开始......而且我不是 MSBuild 专家,所以 Powershell 对我来说看起来相当不错。但我觉得这样我就错过了正确的工具......

你会在哪一步使用什么工具?

I know how many questions have been asked around this, but I still can't figure out the answer to my question.

I need to deploy an ASP.NET 4.0 site, and I want to do something like this:

  1. Get latest version og the entire solution - a website and a couple class projects that are used by the webapp (I am doing this already using CCNet- not a problem)
  2. Build and deploy in debug config to a test site
  3. Build and deploy in a release configuration to a staging site
  4. If everything looks fine on the staging site, I'll run a script that deploys the release build staging site, to 7-8 similar sites used by different customers on the same server. In the future this will be on another server.

There is MSDeploy (webdeploy 2.0), aspnet_compiler, MSBuild, Powershell (my weapon of choice..) and propably more ... I am not 100% sure what to use where?

I would love to mimick the "only deploy files needed to run the site" from the Vs2010 GUI assisted deployment, and I'd love to have the possibility of not touching some existing folders in the websites that we deploy to.

I feel like I should use MSDeploy a lot ... but I find it pretty hard to GET. I'm reading away in IIS.NET and I've heard the Scott Hanselman/Jon Arild Tørresdal podcast. I am not 100% sure where to start ... and I'm not a MSBuild expert, so Powershell is looking pretty good to me. But I feel I'm missing out on the right tools by going that way ...

What tool would you use in which step??

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

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

发布评论

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

评论(1

暮倦 2024-11-24 15:35:40

据我所知,MSDeploy 的构建是为了通过更多的控制来满足您的所有需求。 MSDeploy 是 IIS 团队的产品,它的功能更加丰富。

回答您的问题
注意事项:Svn 作为源代码控制,MSDeploy 用于部署

  1. 您可以使用 SVN 命令行工具在某个临时目录中获取最新版本的源代码,并使用 MSBuild 命令行工具构建它。然后您可以创建可部署到特定环境的部署包或发布内容包。我目前正在开发一个项目,该项目基本上可以创建独立于环境的部署包,这意味着该包可以部署到任何阶段/测试/实时环境。创建部署包的示例是...

    msbuild C:\Projects\NimBuildDeployTestApp\NimBuildDeployWebApp/NimBuildDeployWebApp.csproj /t:package /p:Configuration=Release /p:PackageLocation=C:\Temp\DeployPackage\NimTestWebApp.zip /p:EnablePackageProcessLoggingAndAssert=true

  2. 使用 MSDeploy 命令行工具部署包,如下所示

    msdeploy -verb:sync -source:package=packagelocation -dest:CONFIGURABLE_ACCORDING_TO_YOUR_NEEDS

  3. 用户步骤 2 使用 MSBUILD 在发布模式下构建解决方案并配置msdeploy 中的 dest 参数。

  4. 如果您的登台服务器上一切正常,请运行deploymentToLive.batch 文件,该文件将在您的实时服务器上部署特定的PublishContent/包。在同一个批处理文件中执行 7 个 msdeploy 脚本,或者使用 DFS(这是更为复杂的解决方案)

MSDeploy 绝对是最佳选择。您可能需要考虑的一件事是准备一个可以部署到您的任何环境中的部署包。我的意思是,您的 web.config 文件对于所有环境来说都不会相似,因此创建一个包含所有环境的 web.confif 文件的部署包。请参阅我的解决方案此处

希望这对您有所帮助并给您信心推动部署流程自动化

According to me, MSDeploy is build to achieve all of your needs with much more control. MSDeploy is the product of IIS team and it's far more feature rich.

Answers to your questions
Considerations: Svn as Source control, MSDeploy for deployment

  1. You can use SVN Command line tool to get latest version of your source code in some temp directory and build it using MSBuild command line tool. Then you can create a Deployment Package or a Publish Content Package which can be deployed to specific environment. I am currently working on a project which can basically create a deployment package independent of the environment, means the pacakge can be deployed to any stage/test/live environment. Sample for creating a deployment package is...

    msbuild C:\Projects\NimBuildDeployTestApp\NimBuildDeployWebApp/NimBuildDeployWebApp.csproj /t:package /p:Configuration=Release /p:PackageLocation=C:\Temp\DeployPackage\NimTestWebApp.zip /p:EnablePackageProcessLoggingAndAssert=true

  2. Use MSDeploy command line tool to deploy the package as below

    msdeploy -verb:sync -source:package=packagelocation -dest:CONFIGURABLE_ACCORDING_TO_YOUR_NEEDS

  3. User Step 2 to build the solution in Release mode using MSBUILD and configure the dest parameter in msdeploy.

  4. If everything seems fine on your staging server, run the deploymentToLive.batch file which will deploy a particular PublishContent/package on your live server. Execute 7 msdeploy scripts in same batch file or else use DFS (which is far more complex solution)

MSDeploy is definitely the way to go. One thing that you may consider is having a deployment package ready which can be deployed onto any environment of yours. What I mean by that is your web.config file won't be similar for all the envrionments, and hence create a deployment package which contains web.confif file for all the environments. Refer to my solution here

Hope this helps and gives you confidence in moving forward to automate your deployment process

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