简体   繁体   English

使用WebDeploy msbuild进行部署

[英]Deployment with WebDeploy msbuild

My Goal: use webdeploy to deploy builds from TeamCity to remote IIS server 我的目标:使用webdeploy将构建从TeamCity部署到远程IIS服务器

I am trying to figure out webdeploy but have had little luck. 我试图找出webdeploy,但运气不佳。 Currently to my understanding this is the work flow of webdeploy. 目前,据我了解,这是Web部署的工作流程。

msbuild builds the project -> launches webdeploy tool -> sends data to remote IIS server. msbuild构建项目->启动webdeploy工具->将数据发送到远程IIS服务器。

I haven't seen any indication of this when building my project using paramaters. 在使用参数构建项目时,我还没有看到任何指示。 There is nothing in the build log to indicate that any deployment is going on. 构建日志中没有任何内容指示正在进行任何部署。

C:\Windows\Microsoft.NET\Framework\v4.0.30319>msbuild \src\TestWebsiteApp\TestWe
bsiteApp.sln /p:Configuration=release /p:DeployOnBuild=True /p:DeployTarget=MSDe
ployPublish /p:MSDeployPublishMethod=RemoteAgent /p:MsDeployServiceUrl=localhost
 /p:username=myusername /p:password=mypassword

Could someone layout how webdeploy works and what are the requirements for it. 有人可以安排webdeploy的工作方式以及对它的要求是什么。 What I've gathered is it needs msbuild v4.0 and IIS6 + 我收集的是它需要msbuild v4.0和IIS6 +

Any information / guidance would be much appreciated, thanks. 任何信息/指导将不胜感激,谢谢。

I use Hudson but the principal for setting this up is the same. 我使用Hudson,但是设置它的原理是相同的。 Once you figure out how to successfully deploy the package on to the server from your local machine the rest will be a piece of cake ;) 一旦确定了如何将软件包从本地计算机成功部署到服务器上,其余的工作就轻松了;)

This will make you a package: 这将使您成为一个包裹:

MSBuild "WcfService1.csproj" /T:Package MSBuild“ WcfService1.csproj” / T:打包

Then look for Package folder in your solution folder (should be in obj\\debug). 然后在解决方案文件夹中查找Package文件夹(应该在obj \\ debug中)。 Inside you should see something like this: 在内部,您应该看到类似以下内容:

PackageTmp
WcfService1.deploy-readme.txt
WcfService1.deploy.cmd
WcfService1.SetParameters.xml
WcfService1.SourceManifest.xml
WcfService1.zip

You need to have Web Deployment Tool installed on your server and Remote Agent Service running there as well (after you install WDT I think it's turned off). 您需要在服务器上安装Web部署工具,并在其中运行远程代理服务 (在安装WDT之后,我认为它已关闭)。 If you already have that, open windows console and run 如果已经有了,请打开Windows控制台并运行

WcfService1.deploy.cmd /M:your_server_name /Y WcfService1.deploy.cmd / M:您的服务器名称/ Y

You can use /T instead of /Y to do a test run - nothing will be published but you'll see if you're missing anything. 您可以使用/ T而不是/ Y进行测试运行-什么都不会发布,但是您会发现是否缺少任何内容。

Remember about your app pool identity, access to folders etc. 记住您的应用程序池标识,对文件夹的访问权限等。

Those are just basic steps, for more advanced stuff you'll need to play a bit with SetParameters.xml file and/or with your project properties. 这些只是基本步骤,对于更高级的内容,您需要使用SetParameters.xml文件和/或项目属性来发挥作用。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM