开发者

Using cruisecontrol.net to automate asp.net mvc deployment to a fileshare

I've been struggling to automate the deployment of my asp.net mvc app. I found a few questions on SO regarding this, but none of the answers really helped me along.

My requirements are as follows:

  • Not use NAnt.
  • Not edit the .sln file. I want to use the same file for my dev box too.
  • Deploy to a fileshare
  • Should apply web.config transformations

I found so many different deployment techniques, my head is spinning. And I've still got no idea what to do now. Please help.

---Edit---

Maybe I should rephrase this a bit; after building the website project with开发者_如何学JAVA MSBuild. What should I copy to a file share to "deploy" my webapp?

---2nd Edit---

I'm comparing this to automating the build and deployment of a desktop application: with a desktop application; you just build it using the .sln file. And then copy everything from the bin/(debug|release) folder to the destination of your liking. My question is. What would be the equivalent in a web application?

---And another one---

I've been researching this for some time now. And some things start to fall into place. I now use the following:

msbuild "siteprojectfile.csproj" /T:Package

This way I get a zip file wich I can supposedly use with msdeploy. But I can't seem to use the file to deploy it to a file share. Suggestions are welcome!


I now use two steps:

1

MSBuild.exe Site\Site.csproj /p:Configuration=Test /T:Package

2

aspnet_compiler -nologo -v / -p "Site\obj\Test\Package\PackageTmp" -f "\\server\website"

I could do a simple copy step instead of using aspnet_compiler, but this will also check the views for me, and fail the build if something's wrong.

This works great so far, but I have a feeling ("PackageTMP"...) this is not really optimal nonetheless.


Wondering if this would be any better than the 2 commands above? (Referenced from this article)

msbuild C:\ContosoUniversity\ContosoUniversity.sln /p:DeployOnBuild=true /p:PublishProfile=Test

Noticing that the OP is asking for a file share, the PublishProfile can be setup to do the "To Disk" type publishing, but allows the OP the ability to also change it to go to web, ftp, etc. all with a configuration change... I would think.

Then again, some of this probably only came to light with VS2012, as VS2010 didn't have the ability to source control the publish files like it does in 2012.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜