加速 ASP.NET 网站发布
ASP.NET 网站项目中是否有任何方法允许从命令提示符发布它,并且我可以继续处理项目,或者如果它不容易使用,至少可以加快我的发布任务?
我了解 TFS 或 CruiseControl 等自动发布工具,所以请不要告诉我这些方法。
我正在考虑创建一个 .bat 文件,每次需要发布时都会运行该文件。但它不应该接受我在运行过程中所做的更改。
我真的很喜欢 Ludwo 给出的答案,提供了更多信息对此将会非常有帮助。
Is there any way in ASP.NET website project, that allow to publish it from command prompt and I can continue working on project, or if it is not easy to use , at least speed up my publish task?
I know about the auto publishing tools like TFS or CruiseControl, so please don't tell me these ways.
I am thinking to create a .bat file , that I'll run everytime I have to publish. but it should not take changes made by me during its running process.
I really like the Answer given by Ludwo, providing more information on that would be very helpful.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
您可以使用 MsBuild 并行发布您的网站。 从本文开始。这是关于使用 MsBuild 发布一个网站。在 ItemGroup 中定义项目并以这种方式使用 MSBuild 任务:
最后一步是 为 MSBuild 任务启用并行处理。
You can use MsBuild to publish your websites in parallel. Start with this article. It is about publishing one website using MsBuild. Define your projects inside ItemGroup and use MSBuild task this way:
The final step is to enable parallel processing for MSBuild task.
打开另一个 Visual Studio 继续:P。发布机制可以检测更新并且只能发送更改。因此,如果确实打扰您,请不要每次都上传完整的网站。
Open another Visual Studio to continue :P. Publishing mechanism can detect updated and can send only changes. So dont upload full site everytime, if its really disturbs you.
使用源代码控制和构建服务器机制。当您提交更改、构建项目、执行您可能/应该进行的任何单元测试,然后部署时,构建服务器应该能够从源代码控制中提取到测试站点。
根据您使用的构建服务器平台,您可能需要完成不同数量的工作。过去我使用过 Atlassian 的 Bamboo。很棒的产品,但您必须使用 MSBuild 配置部署 - 这很好,但可能需要一些时间才能使其完美。我确信有一些很好的例子。
它如何为您工作:
当您完成文件/问题的处理后,您可以提交更改。然后,构建服务器将检测这些更改并等待不同的时间(等待您提交更多内容),例如 3 分钟,检查您的更改并进行部署。您可以设置通知,以便在部署完成后通知您的测试团队 - 通过电子邮件中的链接说明站点位置以及发生的更改(基于您的 SVN 提交日志)。
因此,您的最终工作就是用正确的注释签入文件 - 然后您就完成了。
Use source control and a build server mechanism. The build server should be able to pull from source control when you commit a change, build the project, do any unit tests you may/should have, and then deploy to a test site.
Depending on which build server platform you use you may or may have to do varying amounts of work. In the past I have used Bamboo by Atlassian. Fantastic product but you have to configure the deployment using MSBuild - it's fine but it can take some time to get it perfect. I am sure there are some good examples out there for it.
How it will work for you:
When you are finished working on a file/issue you can commit your changes. The build server will then detect these changes and wait a varying amount of time (waiting for you to commit more) e.g. 3 minutes, check out your changes, and deploy. You can set up notifications when the deployment is done to goto your testing team - with a link in the email saying where the site is, and what the change that occurred (based on your SVN commit log).
So your net effort is to check a file in with a correct comment - and you are finished.