Rails3& Git& Heroku - 开发/登台服务器 [英] Rails3 & Git & Heroku - development/staging server

查看:130
本文介绍了Rails3& Git& Heroku - 开发/登台服务器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个Rails 3应用程序,我正在使用Git / Github开发,并部署到Heroku雪松堆栈。我们的Github仓库有两个主要的分支硕士和发展。



我希望将我们的开发分支定期推送到Heroku上的另一台服务器上,作为开发/分段环境。





最简单的方法是将我们的开发分支推向不同于Master的应用程序,而不会中断我们的Git流程。


解决方案

您需要添加第二个git remote,即第二个应用程序的heroku git repo url到您的应用程序,以便能够从单个代码库推送到该应用程序。



目前,您可能拥有名为'heroku'的默认远程原点,它正在推动您的产品应用程序。



您需要添加第二个远程原点,指向您打算用于分级的新Heroku应用程序,例如

  git remote add staging   

一旦你有了新的git origin,你可以通过它推送它;

  git push staging<分支部署>:master 


I have a Rails 3 app I'm developing with a team using Git/Github and deploying to a Heroku cedar stack. Our Github respository has 2 main branches Master and Development.

I would like to push our Development branch regularly to a different server on Heroku as a development/staging environment.

What's the cleanest simplest way to push our Development branch to a different app than Master without disrupting our Git flow much?

Thanks a lot!

解决方案

You'll want to add a second git remote i.e. your second application's heroku git repo url to your app to be able to push to that from a single codebase.

At the moment you probably have the default remote origin named 'heroku' which is pushing to your production application.

You'll want to add a second remote origin pointing at your new heroku app that you intend to use for staging, eg

git remote add staging <git repo url from 'my apps' page on heroku>

once you have the new git origin set up you can push to it via;

git push staging <branch to deploy>:master

这篇关于Rails3&amp; Git&amp; Heroku - 开发/登台服务器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆