我想知道人们如何在生产环境中逐渐推出功能和版本。这些方案是您在生产中有两个版本的测试代码,其中一个是要推出的,这些是常见问题..

  • 同一Rails应用程序内的不同版本的代码。
  • 在推出给用户时的不同版本的Rails应用程序。
  • 在版本之间的不同数据库结构
  • 在新数据库和服务器上移动数据。

    这里是上面的一些想法,以讨论

    • 如果使用m,v,c名称中的常量版本号
    • 将平衡加载到不同的应用服务器(如何制作粘性?),RVM
    • 将表中的旧字段与临时的表中的旧字段,或将记录迁移到新表或

      数据库。
    • 没有简单的方法来移动数据 服务器。
有帮助吗?

解决方案

It sounds like you need a good branching and merging strategy. If you're using something like Git or SVN, then anything on master or trunk, respectively, should be production-ready quality. If you're running into situations where the AbcController is good and ready to go, but XyzController is flaky, then the XyzController probably needs more testing and shouldn't be in master yet.

Migrations in rails also follow this policy, which lead to your data structure. If you think that you're ready for production, then there should't be significant changes to your database. Maybe you need to add a column or feature, but you should be well past wholesale database refactorings.

Finally, uploading/updating data is a pain in any migration situation. In my experience, it involves writing SQL scripts to perform the moves, or update the database for some new feature. Those SQL scripts should also be under your source control. Rails can make this easier, by writing your migration scripts in the migration file itself. Depending on your exact situation, this can work.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top