如何从 VS2010 Web 部署进入命令行 msdeploy
我有一个项目,可以从 VS2010 中部署到 4 个站点,其中 2 个使用基于文件的部署,2 个使用 Web 部署。
一个接一个地等待部署很无聊,所以我想自动化这一过程。在命令行上。
我了解 msdeploy,但我不知道如何告诉它 .Publish.xml 中的相同选项或让它使用保存在那里的设置。
我想要的是一个看起来像
msbuild Project.sln /p:Configuration=Config1
magicDeployingProgram Project.sln /p:PublishXMLConfigurationName="Server1DeploySettings"
msbuild Project.sln /p:Configuration=Config2
magicDeployingProgram Project.sln /p:PublishXMLConfigurationName="Server2DeploySettings"
msbuild Project.sln /p:Configuration=Config3
magicDeployingProgram Project.sln /p:PublishXMLConfigurationName="Server3DeploySettings"
msbuild Project.sln /p:Configuration=Config4
magicDeployingProgram Project.sln /p:PublishXMLConfigurationName="Server4DeploySettings"
或等效的批处理文件。我不介意重新指定 msdeploy 的设置,但是当我尝试此操作时,我找不到指定要部署到哪个 IIS 站点的选项(相当于发布设置对话框中的“站点/应用程序”框) vs2010)。
最后,我不介意它是否只是 Web 部署,我的基于文件的部署是懒惰的产物,我可以在适当的盒子上设置一个 Web 部署代理,我只是还没有这样做。
我一直在寻找有关这方面的信息,但我认为很难找到。
有什么指点吗?
I have a project which I can deploy to 4 sites from within VS2010, 2 using file based deployment and 2 using web deploy.
Its boring to sit through waiting for the deploys one after the other so I'd like to automate this. On the command line.
I know about msdeploy, but I can't see how to either tell it the same options which are in .Publish.xml or get it to use the settings which are saved there.
What I'd like is a batch file which looks something like
msbuild Project.sln /p:Configuration=Config1
magicDeployingProgram Project.sln /p:PublishXMLConfigurationName="Server1DeploySettings"
msbuild Project.sln /p:Configuration=Config2
magicDeployingProgram Project.sln /p:PublishXMLConfigurationName="Server2DeploySettings"
msbuild Project.sln /p:Configuration=Config3
magicDeployingProgram Project.sln /p:PublishXMLConfigurationName="Server3DeploySettings"
msbuild Project.sln /p:Configuration=Config4
magicDeployingProgram Project.sln /p:PublishXMLConfigurationName="Server4DeploySettings"
Or equivalent. I don't mind re-specifying the settings to msdeploy, but when I tried this I couldn't find the option to specify which IIS site to deploy to (the equivalent of the "Site/application" box on the publish settings dialog in vs2010).
Finally, I don't mind if it's web deploy only, my file-based deployment is a product of laziness, and I can set up a web deploy agent on the appropriate box, I just haven't had to yet.
I've been searching for information about this, but it's pretty hard to find, I think.
Any pointers?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
好吧,我想我已经找到了这个。 msbuild 可以做到。
x4 在批处理文件中。
Ok, I think I've found this. msbuild can do it.
x4 in a batch file.