使用 Cruisecontrol.net 自动将 ASP.NET MVC 部署到文件共享
我一直在努力自动化部署我的 ASP.NET MVC 应用程序。我发现了一些与此相关的问题,但没有一个答案真正对我有帮助。
我的要求如下:
- 不使用NAnt。
- 不编辑 .sln 文件。我也想为我的开发盒使用相同的文件。
- 部署到文件共享
- 应该应用 web.config 转换
我发现了很多不同的部署技术,我的头在旋转。我现在仍然不知道该怎么办。请帮忙。
---编辑---
也许我应该稍微改一下;使用 MSBuild 构建网站项目后。我应该将什么复制到文件共享来“部署”我的网络应用程序?
---第二次编辑---
我将其与自动化桌面应用程序的构建和部署进行比较:使用桌面应用程序;您只需使用 .sln 文件构建它。然后将 bin/(debug|release) 文件夹中的所有内容复制到您喜欢的目的地。我的问题是。 Web 应用程序中的等效项是什么?
---还有一个---
我已经研究这个有一段时间了。有些事情开始步入正轨。我现在使用以下命令:
msbuild "siteprojectfile.csproj" /T:Package
这样我就得到了一个 zip 文件,据说我可以将其与 msdeploy 一起使用。但我似乎无法使用该文件将其部署到文件共享。欢迎提出建议!
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 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!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我现在使用两个步骤:
1
2
我可以执行一个简单的复制步骤,而不是使用 aspnet_compiler,但这也会为我检查视图,如果出现问题,构建会失败。
到目前为止,效果很好,但我有一种感觉(“PackageTMP”...)这并不是真正的最佳选择。
I now use two steps:
1
2
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.
想知道这是否比上面的 2 个命令更好? (参考这篇文章)
注意到 OP 要求文件共享,可以将 PublishProfile 设置为执行“到磁盘”类型发布,但允许 OP 也能够将其更改为访问网络, ftp 等,所有这些都需要更改配置...我想。
话又说回来,其中一些问题可能只是在 VS2012 中才被发现,因为 VS2010 没有像 2012 年那样对发布文件进行源代码控制的能力。
Wondering if this would be any better than the 2 commands above? (Referenced from this article)
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.