将现有部署升级到最新版本的最佳方法
我需要自动化将应用程序的现有部署升级到应用程序的最新稳定版本的过程。我目前计划通过将每个更改存储在升级应用程序中,然后按顺序从一个版本升级到每个新版本,直到到达最新版本来实现此目的。每次我们发布新的稳定版本时,我都会强制所有开发人员将升级代码添加到升级应用程序中。这不会那么复杂,除非我们有一个 MySQL 数据库,其中架构有时会发生变化并且我们添加了存储过程。另外,我们通常必须更换一些二进制文件。该应用程序由 Web 应用程序和 Windows 服务组成。
我的问题是,有没有更简单的方法来做到这一点?在我看来,我应该能够打包 Mercurial 存储库并自动将更改推送到已部署的应用程序。我在该应用程序中使用 C#.NET、MySQL 和 ASP.NET。
I need to automate the process of upgrading the existing deployments of an application to the latest stable revision of the application. I currently have a plan to do this by storing each change inside an upgrade application and then upgrading from a version to each new version in sequence until I arrive at the latest version. I would force all of my developers to add the upgrade code to the upgrade application each time we have a new stable release. This wouldn't be that complicated except for we have a MySQL database where the schema sometimes changes and we add stored procedures. Also, we usually have to swap out some binaries. The application consists of a Web Application and a Windows Service.
My question is, is there an easier way to do this? It seems to me that I should be able to package a Mercurial repository and automate pushing the changes to the deployed application. I am using C#.NET, MySQL, and ASP.NET for the application.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我理解为什么您需要对架构更改进行顺序升级,但为什么您要对应用程序执行相同的操作而不是一步升级?不管怎样,有像 KwateeSDCM 或 Capistrano 这样的部署工具可以自动部署到开发/qa/生产服务器。 KwateeSDCM 保留每个文件的 MD5 哈希值,这使得它能够进行差异化升级,当您的大型应用程序频繁升级而仅影响小文件时,这非常有用,因此它最终会做您想要的事情。
I understand why you'd need to have a sequential upgrade of your schema changes but why would you do the same with your application instead of a one-step upgrade? Anyway, there are deployment tools like KwateeSDCM or Capistrano that can automate the deployment to dev/qa/production servers. KwateeSDCM keeps an MD5 hash of every file which allows it to to differential upgrades which is nice when you have large applications with frequent upgrades that impact only small files so it ends up doing pretty much what you want.
我只是让我的一位程序员编写一个非常智能的数据库脚本,不需要存储顺序更改。它只会将当前模式与新模式进行比较并进行更改。这样我就不用担心了。
I am just going to have one of my programmers write a really smart db script that doesn't need to store sequential changes. It will just compare the current schema to the new one and make the changes. That way, I don't have to worry about it.