Best practices for Ruby on Rails *feature* deployment? [closed]

泪湿孤枕 提交于 2019-12-06 06:35:04

Without additional ifs, your best bet would probably be to merge feature branches into master when they're ready to deploy. Alternatively, you could implement a feature toggle pattern. I don't know that there's a common gem for it, but I've used a similar pattern in my own projects. Martin Fowler wrote a good post on feature toggles here if you want to check it out. He makes a pretty valid argument that feature branches go against ideas of continuous integration. I don't feel so strongly about that, so long as the branches are being run through a CI server, but your milage may vary. I'd like to see a good library that just uses blocks with a feature toggle, so you could do something like:

with_feature :something do
  #code that should only be enabled with :something feature
end

Dont know of a well implemented solution for that though. Make a gem and put it on github :)

Use this workflow:

  1. Use master branch as production branch, which always passes tests and deployable
  2. Use branch per feature and Pull Requests on GitHub or Merge Requests on Gitlab
  3. Use CI service (https://travis-ci.org/, https://circleci.com/) to check new branch code before merging
  4. Use special service for stages like http://teatro.io/ which will create parallel stage automatically for every feature branch. Send link for feature-stage to client.
  5. Merge branch tested by CI and cutsomer to master and deploy to production

I think you should keep every new feature in own branches. At first time you can merge it with staging after testing merge with master.

Another way you can try git cherry-pick for move commits belongs to new_user_profile from staging to master

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!