Build/staging environment separate from production application

2009-04-28 Thread teejayvanslyke

Greetings,

We're using Heroku for our production environment and have recently
created a production branch, with the hope that we can continue
feature development on our master branch per most Git-based projects.
However, Heroku seems to enforce that 'master' is the deployed
branch.  This can be circumvented by creating another branch called
'edge' or similar and pushing new changes there.  Our issue now is
that we want to create an additional Heroku deployment for our staging
environment and push the 'edge' branch there.  Since Heroku only
responds to changes on 'master', how can we maintain the pristine,
production-ready state of the master branch for our production
environment while pushing bleeding-edge changes to the staging
environment?

Is anyone else using Heroku for two environments running different
branches of the same repository on each?  What is your solution?

Best regards,

T.J. VanSlyke
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Heroku group.
To post to this group, send email to heroku@googlegroups.com
To unsubscribe from this group, send email to 
heroku+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/heroku?hl=en
-~--~~~~--~~--~--~---



Re: Build/staging environment separate from production application

2009-04-28 Thread Mat Schaffer

On Apr 28, 2009, at 1:50 PM, teejayvanslyke wrote:
 Is anyone else using Heroku for two environments running different
 branches of the same repository on each?  What is your solution?

I'm not doing this, but from my knowledge of git it should be totally  
doable. You'd have two heroku apps, for the sake of discussion call  
them myprodapp and mystagingapp.

You'd add both of these as remotes to your git repo:
git remote add prod g...@heroku.com:myprodapp.git
git remote add staging g...@heroku.com:mystagingapp.git

Then when you want to push to prod from master do:
git checkout master
git push prod master

When you want to push to staging do:
git checkout edge
git push staging master

Git push can also take a source branch so the checkout isn't even  
necessary really. You should be able to do:
git push g...@heroku.com:myprodapp.git master:master
git push g...@heroku.com:mystagingapp.git edge:master

I could be a little off, but that's the basic idea. Check out 'git  
push --help' for more details. Also http://grb.rubyforge.org is  
helpful for dealing with remote branches.

-Mat

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Heroku group.
To post to this group, send email to heroku@googlegroups.com
To unsubscribe from this group, send email to 
heroku+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/heroku?hl=en
-~--~~~~--~~--~--~---



Re: Build/staging environment separate from production application

2009-04-28 Thread Dan Croak
There was a recent blog post about this, along the same lines as Mat's
suggestion:
http://jqr.github.com/2009/04/25/deploying-multiple-environments-on-heroku.html

On Tue, Apr 28, 2009 at 2:30 PM, Mat Schaffer mat.schaf...@gmail.comwrote:


 On Apr 28, 2009, at 1:50 PM, teejayvanslyke wrote:
  Is anyone else using Heroku for two environments running different
  branches of the same repository on each?  What is your solution?

 I'm not doing this, but from my knowledge of git it should be totally
 doable. You'd have two heroku apps, for the sake of discussion call
 them myprodapp and mystagingapp.

 You'd add both of these as remotes to your git repo:
 git remote add prod g...@heroku.com:myprodapp.git
 git remote add staging g...@heroku.com:mystagingapp.git

 Then when you want to push to prod from master do:
 git checkout master
 git push prod master

 When you want to push to staging do:
 git checkout edge
 git push staging master

 Git push can also take a source branch so the checkout isn't even
 necessary really. You should be able to do:
 git push g...@heroku.com:myprodapp.git master:master
 git push g...@heroku.com:mystagingapp.git edge:master

 I could be a little off, but that's the basic idea. Check out 'git
 push --help' for more details. Also http://grb.rubyforge.org is
 helpful for dealing with remote branches.

 -Mat

 



-- 
Dan Croak
http://thoughtbot.com

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Heroku group.
To post to this group, send email to heroku@googlegroups.com
To unsubscribe from this group, send email to 
heroku+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/heroku?hl=en
-~--~~~~--~~--~--~---