MVC 3 部署自动化
我正在寻找最直接的方法来自动化部署 MVC 3 应用程序。 Stack Overflow 上已经有大量信息,但其中大部分似乎已经过时,我不确定哪些内容仍然与 MVC 3 相关。
这是我想要实现的目标:
- 发布 MVC 应用程序
- Zip 文件
- 将 zip 复制到远程位置
这是我遇到最多麻烦的“发布”部分。以下是我的主要困惑点:
- 如何为 MVC 3 应用程序启动自动构建?我们需要使用 AspNetComiler MSBuild 任务吗?我见过一个与 CSC 任务结合使用的示例。两者真的都需要吗?
- Visual Studio 中有一个“构建部署包”选项。可以使用 MSBuild 启动吗?应该用这个来代替吗?
- Web 部署项目:这些项目在哪里?
感谢您的帮助
I am looking for the most straight forward way to automate the deploy of an MVC 3 application. There is a wealth of information on Stack Overflow already, but much of it seems to be old, and I am not sure what is still relevant to MVC 3.
Here is what I am trying to achieve:
- Publish MVC application
- Zip files
- Copy zip to remote location
It is the “Publish” part of this I am having the most trouble with. Here are my main points of confusion:
- How can an automated build be initiated for an MVC 3 app? Do we need to use the AspNetComiler MSBuild Task? I have seen an example of this uses in conjunction with a CSC Task. Are both really needed?
- There is a “Build Deployment Package” option in Visual Studio. Can this be initiated with MSBuild? Should this be used instead?
- Web Deployment Projects: where do these fit into the picture?
Thanks for any help
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
到目前为止,我不是应用程序部署方面的专家,因此可能有更好的方法,但这就是我所做的。
msiexec /u myapp.msi
的任务,然后执行msiexec /i myapp.msi
。备注:在我的例子中,所有构建都是通过 Team Foundation Server 构建以持续集成的方式自动化进行的,但如果您没有构建服务器,您也可以通过运行生成 MSI 的设置和部署项目来手动构建它。
I am by far not specialist in application deployment so there might be better ways but here's what I do.
msiexec /u myapp.msi
and thenmsiexec /i myapp.msi
.Remark : in my case all builds are automated in a continuous integration fashion with a Team Foundation Server Build but if you don't have a build server you could also build it manually by running the setup and deployment project which spits an MSI.