好的Git部署使用分支策略与Heroku

好的Git部署使用分支策略与Heroku

本文介绍了好的Git部署使用分支策略与Heroku?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

使用Git + Heroku(Ruby on Rails)的好的部署策略是什么?



目前我使用的是Git仓库:所有功能(或故事)首先作为分支检出,然后与主人合并并推送到原始。



任何推送到origin / master的东西都会触发一个脚本,导轨代码到分段区域(简单的rails webserver)。



当我将一个新的生产版本推送到Heroku的时候,应该创建一个新的分支(称为类似于production_version_121),并且推动某种方式到Heroku?



理想情况下,我想选择并选择以前开发版本中应包含在生产分支中的哪些功能。 ..测试它,并推送到Heroku。



例如,我可能不希望所有最新的代码被推送到生产。我可能想要的功能一个,我已经工作,功能c都合并成生产不知何故,不包括实验功能b需要更多的调试。



NB我打算尽量避免capistrano,现在可以手动进行某些工作。



想法?最佳实践?

解决方案

在Gemcutter项目中,我们只需要一个 production 分支。我们想要在生产站点上看到的任何更改都会合并到该分支中,然后部署到:

  git push heroku production :master 

staging 分期站点(也在Heroku)的目的


What is a good deployment strategy to use with Git + Heroku (Ruby on Rails)?

Currently the way I work with my origin Git repository: All features (or 'stories') are first checked out as branches, then get merged with master and pushed to origin.

Anything pushed to origin/master triggers a script that pulls the new rails code to the staging area (simple rails webserver).

When the time comes for me to push a new production version to Heroku, should I create a new branch (called something like production_version_121), and push that somehow to Heroku?

Ideally I'd like to pick and choose which features from previous development versions I should include into the production branch... test it, and push to Heroku.

For example, I may not want all the latest code to get pushed to production. I might want feature "a" that I had worked on and feature "c" both merged into production somehow, without including experimental feature "b" which needs more debugging.

N.B. I'm going to try avoiding capistrano at first and get something working manually for now.

Thoughts? Best Practices?

解决方案

In the Gemcutter project we simply have a production branch. Any changes that we want to see on the production site get merged into that branch, and then deployed with:

git push heroku production:master

The staging branch serves a similar purpose for the staging site (also on Heroku)

这篇关于好的Git部署使用分支策略与Heroku?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-04 20:00