解决方案中多个网站项目的持续部署 [英] Continuous deployment with multiple website projects in solution

查看:21
本文介绍了解决方案中多个网站项目的持续部署的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们正在使用 VS2012 并有一个包含 4 个网站项目的解决方案.我们在持续集成 msbuild 参数中添加了以下 MSBuild 参数:

We are using VS2012 and have a solution with 4 website projects in it. We have added the following MSBuild arguments to our Continuous Integration msbuild arguments:

/p:DeployOnBuild=True/P:Configuration=Testing/p:DeployTarget=MsDeployPublish/p:MSDeployPublishMethod=WMSvc/p:CreatePackageOnPublish=False/p:DeployIisAppPath="{test}"/p:SkipExtraFilesOnServer=true/p:MsDeployServiceUrl={test}/MsDeploy.axd/P:AllowUntrustedCertificate=True/p:username={username}/p:password={password}

/p:DeployOnBuild=True /P:Configuration=Testing /p:DeployTarget=MsDeployPublish /p:MSDeployPublishMethod=WMSvc /p:CreatePackageOnPublish=False /p:DeployIisAppPath="{test}" /p:SkipExtraFilesOnServer=true /p:MsDeployServiceUrl={test}/MsDeploy.axd /P:AllowUntrustedCertificate=True /p:username={username}/p:password={password}

当我们签入并运行持续集成时,它会将所有 4 个网站发布到同一个目录.我们如何指定哪个项目属于哪个 IIS 应用程序?

When we do a check in and the continuous integrations runs, it's publishes all 4 websites to the same directory. How do we specify which project belongs to which IIS application?

我们已尝试按照 如何告诉 TFS 部署包含在一个解决方案中的多个 webapp? 进行更改后,签入工作但未发布.

We have tried moving the settings into the csproj as suggested on How to tell TFS to deploy multiple webapps containing in one solution? After making the changes, the check in worked but it didn't publish.

推荐答案

它正在部署到同一个站点,因为您在命令行中传递了 DeployIisAppPath.

It's deploying to the same site because you are passing DeployIisAppPath in at the command line.

您可以在每个 Web 应用程序中创建具有相同名称的发布配置文件(例如 Stage.pubxml),每个都包含不同的 DeployIisAppPath 值.部署时,您可以指定 /p:PublishProfile=Stage,它将使用该配置文件中的设置每个特定项目.

You can create a publish profile in each web application with the same name (eg. Stage.pubxml), each containing a differen DeployIisAppPath value. When you deploy, you can specify /p:PublishProfile=Stage and it will use the settings from that profile for each specific project.

如果您想从命令行指定 SkipExtraFilesOnServerMsDeployServiceUrl 等属性,只需将它们从发布配置文件中删除即可.

If you want to specify properties like SkipExtraFilesOnServer and MsDeployServiceUrl from the command line, just remove them from your publish profiles.

这篇关于解决方案中多个网站项目的持续部署的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆