Code publish through jenkins for .net MVC solution in Ubuntu machine

不羁岁月 提交于 2019-12-08 10:54:09

问题


We have setup a jenkins CI build environment in ubuntu for .net code base.

Following are the steps performed in jenkins and found to be working fine: - Get code base repository from git. - Build the code base using 'XBuild'. Build is possible with Release mode as well.

Post build, the issue we are facing is with publishing the build code. We are able to follow above listed steps, build with MSBuild and publish in Windows. But in Ubuntu, we are unable to publish (locally or externally) as the command line parameters (in shell window) to publish '/p:proj_file_pub.xml' does not work with Ubuntu XBuild build.

We also have mono tool installed in Ubuntu for manually building the .net codebase. In case we can do publish using mono with any shell command, then please do let us know the same.

I would re-iterate the requirement, to build the .net codebase in Jenkins and publish to local or external server. Firstly, we are looking to publish the code locally.

Please suggest appropriate shell command to publish the code base in Ubuntu machine using Jenkins.

PS: The code base is an MVC web application.


回答1:


Success!!!.

After lot of research found that the command to publish a website locally using xbuild in ubuntu is with following command...

xbuild ./sandbox/sandbox.csproj /t:Build /p:OutputPath="/var/code/build" /p:Configuration="Release"

Important parameter to note while publishing in above command is /p:OutputPath. We need to set appropriate path for "OutputPath" for it to publish accordingly.

The published website would be under the path such as /var/code/build/website/Publish_Website folder (not sure of the actual path).

Same command could be used with Jenkins as a shell command to publish website post CI build.

Hope this information helps.



来源:https://stackoverflow.com/questions/32781983/code-publish-through-jenkins-for-net-mvc-solution-in-ubuntu-machine

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