Deploying .NET with Jenkins/Hudson

孤街醉人 提交于 2019-11-30 10:26:23

问题


I've been using Jenkins/Hudson CI for deploying my .NET web site project. I've been using the MSbuild plugin to build my project, and then xcopy to copy it out to the server.

I've noticed if I use the publish feature in Visual Studio I get a different set of files. I've got the config transforms working, but I end up with all the .cs files and a winmerge compare shows the binaries being different.

So, I'd like to either get Jenkins working just like the publish feature, or confirm that an xcopy deploy is functionally the same thing.


回答1:


I've had good experiences with using Web Deploy and as a final build step with Jenkins running a bat file containing:

msdeploy.exe -verb:sync -source:package=%PACKAGE% -dest:auto,ComputerName=%TARGETHOST%

You'll have to install the web deploy package on your build server and the extention on IIS.




回答2:


I'm using the MSBuild Jenkins plugin to build and then deploy the project. As mentioned in other answers, you need to have Web Deploy installed.

In the project configuration page in Jenkins, you need to add the following to the Command Line Arguments field:

/p:Configuration=Debug /p:DeployOnBuild=true /p:PublishProfile=publishProfileName

Of course, you need to first create the publish profile, either in VS or by exporting it from IIS and you also need to specify the solution file path in the MSBuild Build File field.



来源:https://stackoverflow.com/questions/5582095/deploying-net-with-jenkins-hudson

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!